Spaces:
Running
Running
Jon Solow
commited on
Commit
·
c998657
1
Parent(s):
962e128
Replace get_parquet_github with duckdb queries
Browse files
src/queries/nflverse/github_data.py
CHANGED
|
@@ -7,12 +7,6 @@ from typing import Callable
|
|
| 7 |
BASE_URL = "https://github.com/nflverse/nflverse-data/releases/download/"
|
| 8 |
|
| 9 |
|
| 10 |
-
def get_parquet_github(season_int: int, parquet_prefix: str):
|
| 11 |
-
location = f"https://github.com/nflverse/nflverse-data/releases/download/{parquet_prefix}_{season_int}.parquet"
|
| 12 |
-
df = pd.read_parquet(location)
|
| 13 |
-
return df
|
| 14 |
-
|
| 15 |
-
|
| 16 |
FANTASY_POSITIONS = [
|
| 17 |
"QB",
|
| 18 |
"RB",
|
|
@@ -30,19 +24,23 @@ def get_snap_counts(season_int: int) -> pd.DataFrame:
|
|
| 30 |
|
| 31 |
|
| 32 |
def get_play_by_play(season_int: int) -> pd.DataFrame:
|
| 33 |
-
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
def get_player_stats(season_int: int) -> pd.DataFrame:
|
| 37 |
-
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
def get_ftn_charting(season_int: int) -> pd.DataFrame:
|
| 41 |
-
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
def get_pbp_participation(season_int: int) -> pd.DataFrame:
|
| 45 |
-
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
SEASON = "2023"
|
|
|
|
| 7 |
BASE_URL = "https://github.com/nflverse/nflverse-data/releases/download/"
|
| 8 |
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
FANTASY_POSITIONS = [
|
| 11 |
"QB",
|
| 12 |
"RB",
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
def get_play_by_play(season_int: int) -> pd.DataFrame:
|
| 27 |
+
df = duckdb.sql(f"SELECT * from pbp_play_by_play_{season_int}").df()
|
| 28 |
+
return df
|
| 29 |
|
| 30 |
|
| 31 |
def get_player_stats(season_int: int) -> pd.DataFrame:
|
| 32 |
+
df = duckdb.sql("SELECT * from player_stats_player_stats").df()
|
| 33 |
+
return df
|
| 34 |
|
| 35 |
|
| 36 |
def get_ftn_charting(season_int: int) -> pd.DataFrame:
|
| 37 |
+
df = duckdb.sql(f"SELECT * from ftn_charting_ftn_charting_{season_int}").df()
|
| 38 |
+
return df
|
| 39 |
|
| 40 |
|
| 41 |
def get_pbp_participation(season_int: int) -> pd.DataFrame:
|
| 42 |
+
df = duckdb.sql(f"SELECT * from pbp_participation_pbp_participation_{season_int}").df()
|
| 43 |
+
return df
|
| 44 |
|
| 45 |
|
| 46 |
SEASON = "2023"
|