Load Functions¶
nflreadpy.load_pbp ¶
Load NFL play-by-play data.
load_pbp ¶
Load NFL play-by-play data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data since 1999. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with play-by-play data. |
Data Dictionary
Source code in src/nflreadpy/load_pbp.py
nflreadpy.load_player_stats ¶
load_player_stats(
seasons: int | list[int] | bool | None = None,
summary_level: str = "week",
) -> pl.DataFrame
Load NFL player statistics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data. If int or list of ints, loads specified season(s). |
None
|
summary_level
|
str
|
Summary level ("week", "reg", "post", "reg+post"). |
'week'
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with player statistics. |
Source code in src/nflreadpy/load_stats.py
nflreadpy.load_team_stats ¶
load_team_stats(
seasons: int | list[int] | bool | None = None,
summary_level: str = "week",
) -> pl.DataFrame
Load NFL team statistics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data. If int or list of ints, loads specified season(s). |
None
|
summary_level
|
str
|
Summary level ("week", "reg", "post", "reg+post"). |
'week'
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with team statistics. |
Source code in src/nflreadpy/load_stats.py
nflreadpy.load_schedules ¶
Load NFL schedule data.
load_schedules ¶
Load NFL schedules.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If True (default), loads all available data. If int or list of ints, loads specified season(s). If None, loads current season. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with schedule data. |
Data Dictionary
https://nflreadr.nflverse.com/articles/dictionary_schedules.html
Source code in src/nflreadpy/load_schedules.py
nflreadpy.load_players ¶
Load NFL player data.
load_players ¶
Load NFL player information.
This is a comprehensive source of player information including basic details, draft information, positions, and ID mappings across multiple data sources (GSIS, PFR, PFF, OTC, ESB, ESPN).
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with player data - one row per player with comprehensive |
DataFrame
|
player information including names, physical stats, draft info, and |
DataFrame
|
cross-platform ID mappings. |
Data Dictionary
https://nflreadr.nflverse.com/articles/dictionary_players.html
Source code in src/nflreadpy/load_players.py
nflreadpy.load_rosters ¶
Load NFL roster data.
load_rosters ¶
Load NFL team rosters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current roster year. If True, loads all available data since 1920. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with roster data. |
Data Dictionary
https://nflreadr.nflverse.com/articles/dictionary_rosters.html
Source code in src/nflreadpy/load_rosters.py
nflreadpy.load_rosters_weekly ¶
Load NFL weekly rosters data.
load_rosters_weekly ¶
Load NFL weekly rosters data.
Data available from 2002 onwards.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data since 2002. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with weekly roster data including player status |
DataFrame
|
changes, injury designations, and week-by-week roster moves. |
Source code in src/nflreadpy/load_rosters_weekly.py
nflreadpy.load_snap_counts ¶
Load NFL snap count data.
load_snap_counts ¶
Load NFL snap count data.
Data sourced from Pro Football Reference, available since 2012.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data since 2012. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with snap count data including player information, |
DataFrame
|
offensive/defensive snaps, and snap percentages. |
Source code in src/nflreadpy/load_snap_counts.py
nflreadpy.load_nextgen_stats ¶
Load NFL Next Gen Stats data.
load_nextgen_stats ¶
load_nextgen_stats(
stat_type: str = "passing",
seasons: int | list[int] | bool | None = None,
) -> pl.DataFrame
Load NFL Next Gen Stats data.
Data available since 2016.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stat_type
|
str
|
Type of stats to load. Options: "passing", "receiving", "rushing". |
'passing'
|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data since 2016. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with Next Gen Stats data including advanced metrics |
DataFrame
|
for passing, receiving, or rushing performance. |
Source code in src/nflreadpy/load_nextgen_stats.py
nflreadpy.load_ftn_charting ¶
Load FTN charting data.
load_ftn_charting ¶
Load FTN charting data.
Data available since 2022.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data since 2022. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with FTN charting data including detailed |
DataFrame
|
play-by-play charting information and advanced metrics. |
Source code in src/nflreadpy/load_ftn_charting.py
nflreadpy.load_participation ¶
Load NFL participation data.
load_participation ¶
Load NFL participation data.
Data available since 2016.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data since 2016. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with participation data including player involvement |
DataFrame
|
on specific plays and snap participation details. |
Source code in src/nflreadpy/load_participation.py
nflreadpy.load_draft_picks ¶
Load NFL draft pick data.
load_draft_picks ¶
Load NFL draft pick data.
Data covers draft picks since 1980, sourced from Pro Football Reference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If True (default), loads all available data. If int or list of ints, loads specified season(s). If None, loads current season. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with draft pick data including draft year, round, |
DataFrame
|
pick number, player information, and team data. |
Source code in src/nflreadpy/load_draft_picks.py
nflreadpy.load_injuries ¶
Load NFL injury data.
load_injuries ¶
Load NFL injury data.
Data available since 2009.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data since 2009. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with injury data including player information, |
DataFrame
|
injury details, and status reports. |
Data Dictionary
https://nflreadr.nflverse.com/articles/dictionary_injuries.html
Source code in src/nflreadpy/load_injuries.py
nflreadpy.load_contracts ¶
Load NFL contract data.
load_contracts ¶
Load NFL historical contract data.
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with historical contract information including |
DataFrame
|
player details, contract terms, values, and team information. |
Data Dictionary
https://nflreadr.nflverse.com/articles/dictionary_contracts.html
Source code in src/nflreadpy/load_contracts.py
nflreadpy.load_officials ¶
Load NFL officials data.
load_officials ¶
Load NFL officials data.
Data covers NFL officials assigned to games from 2015 onwards.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If True (default), loads all available data. If int or list of ints, loads specified season(s). If None, loads current season. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with officials data including referee assignments, |
DataFrame
|
crew information, and game details. |
Source code in src/nflreadpy/load_officials.py
nflreadpy.load_combine ¶
Load NFL Combine data.
load_combine ¶
Load NFL Combine data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If True (default), loads all available data. If int or list of ints, loads specified season(s). If None, loads current season. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with NFL Combine data including player measurements, |
DataFrame
|
test results (40-yard dash, bench press, etc.), and draft information. |
Data Dictionary
https://nflreadr.nflverse.com/articles/dictionary_combine.html
Source code in src/nflreadpy/load_combine.py
nflreadpy.load_depth_charts ¶
Load NFL depth charts data.
load_depth_charts ¶
Load NFL depth charts data.
Data available from 2001 onwards.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | bool | None
|
Season(s) to load. If None, loads current season. If True, loads all available data since 2001. If int or list of ints, loads specified season(s). |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with depth charts data including player positions, |
DataFrame
|
depth chart rankings, and team information. |
Source code in src/nflreadpy/load_depth_charts.py
nflreadpy.load_trades ¶
Load NFL trades data.
load_trades ¶
Load NFL trades data.
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with NFL trade information including players, |
DataFrame
|
teams, draft picks, and trade details. |
Data Dictionary
https://nflreadr.nflverse.com/articles/dictionary_trades.html
Source code in src/nflreadpy/load_trades.py
nflreadpy.load_ff_playerids ¶
Load fantasy football player IDs from DynastyProcess.com database.
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with comprehensive player ID mappings across platforms. |
Note
This function loads data from an R data file (.rds). While Python cannot directly read RDS files, we attempt to use CSV format if available.
Source code in src/nflreadpy/load_ffverse.py
nflreadpy.load_ff_rankings ¶
Load fantasy football rankings and projections.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type
|
Literal['draft', 'week', 'all']
|
Type of rankings to load: - "draft": Draft rankings/projections - "week": Weekly rankings/projections - "all": All historical rankings/projections |
'draft'
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with fantasy football rankings data. |
Source code in src/nflreadpy/load_ffverse.py
nflreadpy.load_ff_opportunity ¶
load_ff_opportunity(
seasons: int | list[int] | None = None,
stat_type: Literal[
"weekly", "pbp_pass", "pbp_rush"
] = "weekly",
model_version: Literal["latest", "v1.0.0"] = "latest",
) -> pl.DataFrame
Load fantasy football opportunity data.
This function loads opportunity and target share data for fantasy football analysis from the ffverse/ffopportunity repository.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seasons
|
int | list[int] | None
|
Season(s) to load. If None (default), loads current season. If int or list of ints, loads specified season(s). True loads all seasons. |
None
|
stat_type
|
Literal['weekly', 'pbp_pass', 'pbp_rush']
|
Type of stats to load: - "weekly": Weekly opportunity data - "pbp_pass": Play-by-play passing data - "pbp_rush": Play-by-play rushing data |
'weekly'
|
model_version
|
Literal['latest', 'v1.0.0']
|
Model version to load: - "latest": Most recent model version - "v1.0.0": Specific model version |
'latest'
|
Returns:
Type | Description |
---|---|
DataFrame
|
Polars DataFrame with fantasy football opportunity data. |
Raises:
Type | Description |
---|---|
ValueError
|
If season is outside valid range or invalid parameters provided. |
Source code in src/nflreadpy/load_ffverse.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|