MHL — additional Python functions
Hand-written wrappers, loaders, and helpers in sportsdataverse.mhl
not covered by the generated API-endpoint reference above.
Utilities & helpers
most_recent_mhl_season() -> 'int'
Most-recent MHL season as an end-year integer (max season_yr), or 2026.
Other
build_family(league: 'str') -> 'dict[str, Any]'
Return a dict of public callables for league.
All callables are fully independent closures over the single league
string; none share mutable state. The dict is ready to be spread into
a module namespace via globals().update(...).
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
league | str | HockeyTech league code: "ahl", "ohl", "whl", or "qmjhl". |
Returns
Keys are the public function names (e.g. "ahl_schedule").
mhl_game_corsi(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'
Player-level on-ice Corsi and Fenwick for a single MHL game.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ||
return_as_pandas | bool | False |
mhl_game_shifts(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'
Parsed shift stints for a single MHL game.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ||
return_as_pandas | bool | False |
mhl_game_summary(game_id: 'int') -> 'dict'
MHL game summary — dict of frames (game/goals/penalties/shots_by_period/three_stars).
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int |
mhl_leaders(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'
MHL 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 |
mhl_pbp(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'
MHL play-by-play — one row per event, fully enriched.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ||
return_as_pandas | bool | False |
mhl_player_stats(player_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'
MHL player season stats across all seasons.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
player_id | int | ||
return_as_pandas | bool | False |
mhl_player_toi(game_id: 'int', return_as_pandas: 'bool' = False) -> 'Any'
Per-player time-on-ice totals for a single MHL game.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ||
return_as_pandas | bool | False |
mhl_schedule(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'
MHL schedule — one row per game.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
season | Optional[int] | None | |
season_id | Optional[int] | None | |
return_as_pandas | bool | False |
mhl_season_id(return_as_pandas: 'bool' = False) -> 'Any'
All MHL seasons with end-year + game-type labels.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
return_as_pandas | bool | False |
mhl_standings(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'
MHL standings — one row per team.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
season | Optional[int] | None | |
season_id | Optional[int] | None | |
return_as_pandas | bool | False |
mhl_team_roster(team_id: 'int', season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'
MHL 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 |
mhl_teams(season: 'Optional[int]' = None, season_id: 'Optional[int]' = None, return_as_pandas: 'bool' = False) -> 'Any'
MHL teams for a given season.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
season | Optional[int] | None | |
season_id | Optional[int] | None | |
return_as_pandas | bool | False |