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
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ||
return_as_pandas | bool | False |
whl_game_shifts(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'
Parsed shift stints for a single WHL game.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ||
return_as_pandas | bool | False |
whl_game_summary(game_id: 'int') -> 'dict'
WHL game summary — dict of frames (game/goals/penalties/shots_by_period/three_stars).
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int |
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
| Parameter | Type | Default | Description |
|---|---|---|---|
season | Optional[int] | None | |
season_id | Optional[int] | None | |
return_as_pandas | bool | False |
Returns
| col_name | type | description |
|---|---|---|
rank | integer | Rank of the streak. |
player_id | character | Unique player identifier. |
jersey_number | character | Jersey number. |
name | character | Team mascot name. |
team_id | character | Unique team identifier. |
team_name | character | Team name. |
team_code | character | Team abbreviation. |
team_logo | character | URL to the team logo image. |
team_logo_small | character | |
stat_formatted | character | |
type_formatted | character | |
photo | character | URL to the player photo. |
photo_small | character | |
position | character | Player position. |
division | character | Division identifier. |
whl_pbp(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'
WHL play-by-play — one row per event, fully enriched.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ||
return_as_pandas | bool | False |
whl_player_stats(player_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'
WHL player season stats across all seasons.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
player_id | int | ||
return_as_pandas | bool | False |
Returns
| col_name | type | description |
|---|---|---|
season_id | character | Season identifier. |
season_name | character | Full season name (e.g., "2024-25 Regular Season"). |
shortname | character | Player short name. |
playoff | character | Whether the row is playoff statistics. |
career | character | Whether this is a career-stats season. |
sopt_track_faceoffs | character | |
max_start_date | character | Latest game start date for the season. |
veteran_status | character | Player veteran status. |
veteran | character | Whether the player is a veteran. |
jersey_number | character | Jersey number. |
goals | character | Goals scored. |
games_played | character | Games played. |
assists | character | Assists. |
points | character | Total points (goals + assists). |
plus_minus | character | Plus/minus rating. |
penalty_minutes | character | Penalty minutes. |
power_play_goals | character | Power-play goals. |
power_play_assists | character | Power-play assists. |
shots | character | Shots on goal. |
shootout_attempts | character | Shootout attempts. |
shootout_goals | character | Shootout goals. |
shootout_percentage | character | Shootout scoring percentage. |
shooting_percentage | character | Shooting percentage. |
shootout_winning_goals | character | Shootout game-winning goals. |
points_per_game | character | Points per game. |
short_handed_goals | character | Short-handed goals. |
short_handed_assists | character | Short-handed assists. |
game_winning_goals | character | Game-winning goals. |
game_tieing_goals | character | Game-tying goals. |
faceoff_wins | character | Faceoff wins. |
faceoff_attempts | character | Faceoff attempts. |
faceoff_pct | character | Faceoff win percentage. |
hits | character | Hits. |
team_name | character | Team name. |
team_code | character | Team abbreviation. |
team_city | character | Team city. |
team_nickname | character | Team nickname. |
team_id | character | Unique team identifier. |
active | character | Whether athlete is currently active. |
first_goals | character | First goals of a game. |
insurance_goals | character | Insurance goals. |
overtime_goals | character | Overtime goals. |
unassisted_goals | character | Unassisted goals. |
empty_net_goals | character | Empty-net goals. |
penalty_minutes_per_game | character | Penalty minutes per game. |
division | character | Division identifier. |
ice_time | character | Total ice time. |
ice_time_minutes_seconds | character | Ice time in minutes and seconds. |
shots_blocked_by_player | character | Shots blocked by the player. |
stat_type | character | Statistic 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
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ||
return_as_pandas | bool | False |
whl_schedule(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'
WHL schedule — one row per game.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
season | Optional[int] | None | |
season_id | Optional[int] | None | |
return_as_pandas | bool | False |
Returns
| col_name | type | description |
|---|---|---|
game_id | character | Unique game identifier. |
game_date | character | Game date. |
game_status | character | Game status text. |
home_team | character | Home team name. |
home_team_id | character | Home team identifier. |
home_score | character | Home team final score. |
away_team | character | Away team name. |
away_team_id | character | Away team identifier. |
away_score | character | Away team final score. |
venue | character | Venue where the game was played. |
season_id | character | Season identifier. |
game_type | character | Game type the row belongs to. |
whl_season_id(return_as_pandas: 'bool' = False) -> 'Any'
All WHL seasons with end-year + game-type labels.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
return_as_pandas | bool | False |
Returns
| col_name | type | description |
|---|---|---|
season_id | integer | Season identifier. |
season_name | character | Full season name (e.g., "2024-25 Regular Season"). |
season_short | character | Short season name. |
career | character | Whether this is a career-stats season. |
playoff | character | Whether the row is playoff statistics. |
start_date | character | Season start date. |
end_date | character | Season end date. |
season_yr | double | Year derived from the season name (concluding year). |
game_type_label | character | Game 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
| Parameter | Type | Default | Description |
|---|---|---|---|
season | Optional[int] | None | |
season_id | Optional[int] | None | |
return_as_pandas | bool | False |
Returns
| col_name | type | description |
|---|---|---|
team_code | character | Team abbreviation. |
wins | character | Wins. |
losses | character | Losses. |
ties | character | Total ties. |
ot_losses | character | Overtime losses. |
ot_wins | character | Overtime wins. |
shootout_wins | character | Shootout wins. |
shootout_losses | character | Shootout losses. |
regulation_wins | character | Wins in regulation. |
row | character | Row index within the game grouping (sequencing helper). |
points | character | Total points (goals + assists). |
penalty_minutes | character | Penalty minutes. |
streak | character | Current streak value. |
goals_for | character | Goals for. |
goals_against | character | Goals against. |
goals_diff | character | |
percentage | character | |
games_played | character | Games played. |
team_rank | integer | Team rank in the standings. |
past_10 | character | |
team | character | Team 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
| Parameter | Type | Default | Description |
|---|---|---|---|
team_id | int | ||
season | Optional[int] | None | |
season_id | Optional[int] | None | |
return_as_pandas | bool | False |
whl_teams(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'
WHL teams for a given season.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
season | Optional[int] | None | |
season_id | Optional[int] | None | |
return_as_pandas | bool | False |
Returns
| col_name | type | description |
|---|---|---|
team_name | character | Team name. |
team_id | character | Unique team identifier. |
team_code | character | Team abbreviation. |
team_nickname | character | Team nickname. |
team_label | character | Short city label. |
division | character | Division identifier. |
team_logo | character | URL to the team logo image. |