Skip to main content
Version: 0.0.56

WHL — additional Python functions

Hand-written wrappers, loaders, and helpers in sportsdataverse.whl not covered by the generated API-endpoint reference above.

Utilities & helpers

most_recent_whl_season() -> 'int'

Most-recent WHL season as an end-year integer (max season_yr), or 2026.

Other

whl_game_corsi(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'

Player-level on-ice Corsi and Fenwick for a single WHL game.

Parameters

ParameterTypeDefaultDescription
game_idint
return_as_pandasboolFalse

whl_game_shifts(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'

Parsed shift stints for a single WHL game.

Parameters

ParameterTypeDefaultDescription
game_idint
return_as_pandasboolFalse

whl_game_summary(game_id: 'int') -> 'dict'

WHL game summary — dict of frames (game/goals/penalties/shots_by_period/three_stars).

Parameters

ParameterTypeDefaultDescription
game_idint

whl_leaders(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'

WHL statistical leaders for a given season.

Parameters

ParameterTypeDefaultDescription
seasonOptional[int]None
season_idOptional[int]None
return_as_pandasboolFalse

Returns

col_nametypedescription
rankintegerRank of the streak.
player_idcharacterUnique player identifier.
jersey_numbercharacterJersey number.
namecharacterTeam mascot name.
team_idcharacterUnique team identifier.
team_namecharacterTeam name.
team_codecharacterTeam abbreviation.
team_logocharacterURL to the team logo image.
team_logo_smallcharacter
stat_formattedcharacter
type_formattedcharacter
photocharacterURL to the player photo.
photo_smallcharacter
positioncharacterPlayer position.
divisioncharacterDivision identifier.

whl_pbp(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'

WHL play-by-play — one row per event, fully enriched.

Parameters

ParameterTypeDefaultDescription
game_idint
return_as_pandasboolFalse

whl_player_stats(player_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'

WHL player season stats across all seasons.

Parameters

ParameterTypeDefaultDescription
player_idint
return_as_pandasboolFalse

Returns

col_nametypedescription
season_idcharacterSeason identifier.
season_namecharacterFull season name (e.g., "2024-25 Regular Season").
shortnamecharacterPlayer short name.
playoffcharacterWhether the row is playoff statistics.
careercharacterWhether this is a career-stats season.
sopt_track_faceoffscharacter
max_start_datecharacterLatest game start date for the season.
veteran_statuscharacterPlayer veteran status.
veterancharacterWhether the player is a veteran.
jersey_numbercharacterJersey number.
goalscharacterGoals scored.
games_playedcharacterGames played.
assistscharacterAssists.
pointscharacterTotal points (goals + assists).
plus_minuscharacterPlus/minus rating.
penalty_minutescharacterPenalty minutes.
power_play_goalscharacterPower-play goals.
power_play_assistscharacterPower-play assists.
shotscharacterShots on goal.
shootout_attemptscharacterShootout attempts.
shootout_goalscharacterShootout goals.
shootout_percentagecharacterShootout scoring percentage.
shooting_percentagecharacterShooting percentage.
shootout_winning_goalscharacterShootout game-winning goals.
points_per_gamecharacterPoints per game.
short_handed_goalscharacterShort-handed goals.
short_handed_assistscharacterShort-handed assists.
game_winning_goalscharacterGame-winning goals.
game_tieing_goalscharacterGame-tying goals.
faceoff_winscharacterFaceoff wins.
faceoff_attemptscharacterFaceoff attempts.
faceoff_pctcharacterFaceoff win percentage.
hitscharacterHits.
team_namecharacterTeam name.
team_codecharacterTeam abbreviation.
team_citycharacterTeam city.
team_nicknamecharacterTeam nickname.
team_idcharacterUnique team identifier.
activecharacterWhether athlete is currently active.
first_goalscharacterFirst goals of a game.
insurance_goalscharacterInsurance goals.
overtime_goalscharacterOvertime goals.
unassisted_goalscharacterUnassisted goals.
empty_net_goalscharacterEmpty-net goals.
penalty_minutes_per_gamecharacterPenalty minutes per game.
divisioncharacterDivision identifier.
ice_timecharacterTotal ice time.
ice_time_minutes_secondscharacterIce time in minutes and seconds.
shots_blocked_by_playercharacterShots blocked by the player.
stat_typecharacterStatistic type ("regular"/"playoff").

whl_player_toi(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'

Per-player time-on-ice totals for a single WHL game.

Parameters

ParameterTypeDefaultDescription
game_idint
return_as_pandasboolFalse

whl_schedule(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'

WHL schedule — one row per game.

Parameters

ParameterTypeDefaultDescription
seasonOptional[int]None
season_idOptional[int]None
return_as_pandasboolFalse

Returns

col_nametypedescription
game_idcharacterUnique game identifier.
game_datecharacterGame date.
game_statuscharacterGame status text.
home_teamcharacterHome team name.
home_team_idcharacterHome team identifier.
home_scorecharacterHome team final score.
away_teamcharacterAway team name.
away_team_idcharacterAway team identifier.
away_scorecharacterAway team final score.
venuecharacterVenue where the game was played.
season_idcharacterSeason identifier.
game_typecharacterGame type the row belongs to.

whl_season_id(return_as_pandas: 'bool' = False) -> 'Any'

All WHL seasons with end-year + game-type labels.

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalse

Returns

col_nametypedescription
season_idintegerSeason identifier.
season_namecharacterFull season name (e.g., "2024-25 Regular Season").
season_shortcharacterShort season name.
careercharacterWhether this is a career-stats season.
playoffcharacterWhether the row is playoff statistics.
start_datecharacterSeason start date.
end_datecharacterSeason end date.
season_yrdoubleYear derived from the season name (concluding year).
game_type_labelcharacterGame type: "preseason", "regular", or "playoffs".

whl_standings(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'

WHL standings — one row per team.

Parameters

ParameterTypeDefaultDescription
seasonOptional[int]None
season_idOptional[int]None
return_as_pandasboolFalse

Returns

col_nametypedescription
team_codecharacterTeam abbreviation.
winscharacterWins.
lossescharacterLosses.
tiescharacterTotal ties.
ot_lossescharacterOvertime losses.
ot_winscharacterOvertime wins.
shootout_winscharacterShootout wins.
shootout_lossescharacterShootout losses.
regulation_winscharacterWins in regulation.
rowcharacterRow index within the game grouping (sequencing helper).
pointscharacterTotal points (goals + assists).
penalty_minutescharacterPenalty minutes.
streakcharacterCurrent streak value.
goals_forcharacterGoals for.
goals_againstcharacterGoals against.
goals_diffcharacter
percentagecharacter
games_playedcharacterGames played.
team_rankintegerTeam rank in the standings.
past_10character
teamcharacterTeam name.

whl_team_roster(team_id: 'int', season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'

WHL team roster for a given team + season.

Parameters

ParameterTypeDefaultDescription
team_idint
seasonOptional[int]None
season_idOptional[int]None
return_as_pandasboolFalse

whl_teams(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'

WHL teams for a given season.

Parameters

ParameterTypeDefaultDescription
seasonOptional[int]None
season_idOptional[int]None
return_as_pandasboolFalse

Returns

col_nametypedescription
team_namecharacterTeam name.
team_idcharacterUnique team identifier.
team_codecharacterTeam abbreviation.
team_nicknamecharacterTeam nickname.
team_labelcharacterShort city label.
divisioncharacterDivision identifier.
team_logocharacterURL to the team logo image.