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: Literal[
"week", "reg", "post", "reg+post"
] = "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
|
Literal['week', 'reg', 'post', 'reg+post']
|
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: Literal[
"week", "reg", "post", "reg+post"
] = "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
|
Literal['week', 'reg', 'post', 'reg+post']
|
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_teams ¶
Load NFL team data.
load_teams ¶
Load NFL team information.
Returns:
| Type | Description |
|---|---|
DataFrame
|
Polars DataFrame with team data including abbreviations, names, colors, logos, and other team metadata. |
Source code in src/nflreadpy/load_teams.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 player information including names, physical stats, draft info, and 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 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, 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(
seasons: int | list[int] | bool | None = None,
stat_type: Literal[
"passing", "receiving", "rushing"
] = "passing",
) -> pl.DataFrame
Load NFL Next Gen Stats 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
|
stat_type
|
Literal['passing', 'receiving', 'rushing']
|
Type of stats to load. Options: "passing", "receiving", "rushing". |
'passing'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Polars DataFrame with Next Gen Stats data including advanced metrics 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 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 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, 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, 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 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, 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, 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, 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, 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_pfr_advstats ¶
Load Pro Football Reference advanced statistics.
load_pfr_advstats ¶
load_pfr_advstats(
seasons: int | list[int] | bool | None = None,
stat_type: Literal[
"pass", "rush", "rec", "def"
] = "pass",
summary_level: Literal["week", "season"] = "week",
) -> pl.DataFrame
Load Pro Football Reference advanced 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 (2018-current). If int or list of ints, loads specified season(s). Only used when summary_level="week". |
None
|
stat_type
|
Literal['pass', 'rush', 'rec', 'def']
|
Type of statistics to load: - "pass": Passing statistics - "rush": Rushing statistics - "rec": Receiving statistics - "def": Defensive statistics |
'pass'
|
summary_level
|
Literal['week', 'season']
|
Summary level: - "week": Weekly statistics by season - "season": Season-level statistics (all seasons combined) |
'week'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Polars DataFrame with Pro Football Reference advanced statistics. |
Note
Data is available from 2018 onwards.
See Also
Source code in src/nflreadpy/load_pfr_advstats.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. |