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_idintegerUnique game identifier.
season_fullcharacterFull season label (e.g. 20212022).
game_typecharacterGame type the row belongs to.
game_datecharacterGame date.
game_timecharacterScheduled start time of the game.
home_team_abbrcharacterHome team abbreviation.
away_team_abbrcharacterAway team abbreviation.
home_team_namecharacterHome team name.
away_team_namecharacterAway team name.
home_scoreintegerHome team final score.
away_scoreintegerAway team final score.
game_statecharacterGame state (e.g., FINAL, LIVE).
venuecharacterVenue where the game was played.
series_lettercharacterSingle-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_roundintegerPlayoff round identifier.
series_game_numberinteger
seasonintegerSeason year (echoed from arg).
game_jsonlogicalWhether processed game JSON is available.
game_json_urlcharacterURL to the processed game JSON.
PBPlogicalWhether play-by-play data is available.
team_boxlogicalWhether team box score data is available.
player_boxlogicalWhether player box score data is available.
skater_boxlogicalWhether skater box data is available.
goalie_boxlogicalWhether goalie box data is available.
game_infologicalWhether game info data is available.
game_rosterslogicalWhether game rosters data is available.
scoringlogical
penaltieslogicalPenalty count.
scratcheslogicalLogical flag indicating whether a scratches list (players healthy-scratched and not dressing) is available for this game in the NHL games loader output.
linescorelogicalLogical flag indicating whether linescore data (period-by-period scoring breakdown) is available for this game in the NHL games loader output.
three_starslogicalWhether three stars data is available.
shiftslogicalNumber of shifts.
officialslogicalWhether officials data is available.
shots_by_periodlogicalWhether shots-by-period data is available.
shootoutlogicalWhether 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.