Skip to main content

NHL — additional Python functions — sportsdataverse-data releases

load_nhl_games​

load_nhl_games(return_as_pandas: 'bool' = False)

Load the NHL games-in-data-repo manifest (no seasons argument).

Mirrors fastRhockey (R) load_nhl_games() which reads a manifest of every NHL game that has processed data in the data repository.

Tries the sportsdataverse-data release asset first; falls back to the raw fastRhockey-data GitHub path.

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalsereturn a pandas DataFrame instead of polars.

Returns

A polars (or pandas) DataFrame of all games in the data repository.

col_nametypedescription
game_idInt64Unique game identifier.
season_fullStringFull season label (e.g. 20212022).
game_typeStringGame type the row belongs to.
game_dateStringGame date.
game_timeStringScheduled start time of the game.
home_team_abbrStringHome team abbreviation.
away_team_abbrStringAway team abbreviation.
home_team_nameStringHome team name.
away_team_nameStringAway team name.
home_scoreInt64Home team final score.
away_scoreInt64Away team final score.
game_stateStringGame state (e.g., FINAL, LIVE).
venueStringVenue where the game was played.
series_letterStringSingle-letter identifier for the playoff series to which this game belongs, used to group games within the same bracket matchup in the NHL games dataset.
playoff_roundInt64Playoff round identifier.
series_game_numberInt64
seasonInt64Season year (echoed from arg).
game_jsonBooleanWhether processed game JSON is available.
game_json_urlStringURL to the processed game JSON.
PBPBooleanWhether play-by-play data is available.
team_boxBooleanWhether team box score data is available.
player_boxBooleanWhether player box score data is available.
skater_boxBooleanWhether skater box data is available.
goalie_boxBooleanWhether goalie box data is available.
game_infoBooleanWhether game info data is available.
game_rostersBooleanWhether game rosters data is available.
scoringBoolean
penaltiesBooleanPenalty count.
scratchesBooleanLogical flag indicating whether a scratches list (players healthy-scratched and not dressing) is available for this game in the NHL games loader output.
linescoreBooleanLogical flag indicating whether linescore data (period-by-period scoring breakdown) is available for this game in the NHL games loader output.
three_starsBooleanWhether three stars data is available.
shiftsBooleanNumber of shifts.
officialsBooleanWhether officials data is available.
shots_by_periodBooleanWhether shots-by-period data is available.
shootoutBooleanWhether shootout data is available.

Example

load_nhl_games()

load_nhl_goalie_box​

load_nhl_goalie_box(seasons, return_as_pandas: 'bool' = False)

Alias of load_nhl_goalie_boxscores() for naming parity with fastRhockey (R).

Parameters

ParameterTypeDefaultDescription
seasonsA season or list of seasons, as END years (2026 = the 2025-26 season).
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

Exactly what load_nhl_goalie_boxscores returns -- one row per goalie per game, the requested seasons stacked; see its documented columns. A pandas DataFrame when return_as_pandas is True.

load_nhl_player_box​

load_nhl_player_box(seasons, return_as_pandas: 'bool' = False)

Alias of load_nhl_player_boxscore() for naming parity with fastRhockey (R).

Parameters

ParameterTypeDefaultDescription
seasonsA season or list of seasons, as END years (2026 = the 2025-26 season).
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

Exactly what load_nhl_player_boxscore returns -- one row per player per game, the requested seasons stacked; see its documented columns. A pandas DataFrame when return_as_pandas is True.

load_nhl_skater_box​

load_nhl_skater_box(seasons, return_as_pandas: 'bool' = False)

Alias of load_nhl_skater_boxscores() for naming parity with fastRhockey (R).

Parameters

ParameterTypeDefaultDescription
seasonsA season or list of seasons, as END years (2026 = the 2025-26 season).
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

Exactly what load_nhl_skater_boxscores returns -- one row per skater per game, the requested seasons stacked; see its documented columns. A pandas DataFrame when return_as_pandas is True.

load_nhl_team_box​

load_nhl_team_box(seasons, return_as_pandas: 'bool' = False)

Alias of load_nhl_team_boxscore() for naming parity with fastRhockey (R).

Parameters

ParameterTypeDefaultDescription
seasonsA season or list of seasons, as END years (2026 = the 2025-26 season).
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

Exactly what load_nhl_team_boxscore returns -- one row per team per game, the requested seasons stacked; see its documented columns. A pandas DataFrame when return_as_pandas is True.