Skip to main content

MJHL — additional Python functions

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

Utilities & helpers​

most_recent_mjhl_season​

most_recent_mjhl_season() -> 'int'

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

Other​

build_family​

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

ParameterTypeDefaultDescription
leaguestrHockeyTech league code: "ahl", "ohl", "whl", or "qmjhl".

Returns

Keys are the public function names (e.g. "ahl_schedule").

mjhl_game_corsi​

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

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

Parameters

ParameterTypeDefaultDescription
game_idint
return_as_pandasboolFalse

mjhl_game_shifts​

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

Parsed shift stints for a single MJHL game.

Parameters

ParameterTypeDefaultDescription
game_idint
return_as_pandasboolFalse

mjhl_game_summary​

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

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

Parameters

ParameterTypeDefaultDescription
game_idint

mjhl_leaders​

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

MJHL statistical leaders for a given season.

Parameters

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

Returns

col_nametypedescription
rankintegerPosition of the school within the poll for the given week (1 = top-ranked).
player_idcharacterUnique player identifier.
jersey_numbercharacterJersey number.
namecharacterDisplay name.
team_idcharacterUnique team identifier.
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_codecharacterInternal team code.
team_logocharacterTeam logo image URL.
team_logo_smallcharacterURL of the logo of the leader's team; the host and path vary by league and team (an lscluster.hockeytech.com download.php link or an assets.leaguestat.com logos path), and it can be the same URL as team_logo.
stat_formattedcharacterThe leader's value in the type_formatted category as a display string; for the Points and Goals leaderboards requested here it is a whole-number count (e.g. '29'), and '0' on every row when the season has no games yet.
type_formattedcharacterLeaderboard the row belongs to, 'Points' or 'Goals': the function requests those two skater stat types and stacks both leaderboards into one frame.
photocharacterURL to the player photo.
photo_smallcharacterURL of the player's 60x60 headshot on assets.leaguestat.com, keyed by league and player_id (e.g. 'https://assets.leaguestat.com//60x60/<player_id>.jpg'), or the generic placeholder 'https://lscluster.hockeytech.com/img/nophoto.png'.
positioncharacterListed roster position (G, F, C, etc.).
divisioncharacterTeam division.

mjhl_pbp​

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

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

Parameters

ParameterTypeDefaultDescription
game_idint
return_as_pandasboolFalse

mjhl_player_stats​

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

MJHL player season stats across all seasons.

Parameters

ParameterTypeDefaultDescription
player_idint
return_as_pandasboolFalse

mjhl_player_toi​

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

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

Parameters

ParameterTypeDefaultDescription
game_idint
return_as_pandasboolFalse

mjhl_schedule​

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

MJHL 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 (YYYY-MM-DD).
game_statuscharacterGame status label.
home_teamcharacterHome team name.
home_team_idcharacterUnique identifier for the home team.
home_scorecharacterHome team score at the time of the play.
away_teamcharacterAway team name.
away_team_idcharacterUnique identifier for the away team.
away_scorecharacterAway team score at the time of the play.
venuecharacterVenue name.
season_idcharacterUnique season identifier.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.

mjhl_season_id​

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

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

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalse

Returns

col_nametypedescription
season_idintegerUnique season 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_datecharacterStart date (YYYY-MM-DD).
end_datecharacterEnd date (YYYY-MM-DD).
season_yrintegerYear derived from the season name (concluding year).
game_type_labelcharacterGame type: "preseason", "regular", or "playoffs".

mjhl_standings​

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

MJHL standings — one row per team.

Parameters

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

Returns

col_nametypedescription
team_codecharacterInternal team code.
winscharacterTotal wins.
lossescharacterTotal losses.
ot_lossescharacterOvertime losses.
ot_winscharacterOvertime wins.
shootout_lossescharacterShootout losses.
pointsintegerPoints scored.
penalty_minutescharacterPenalty minutes.
goals_forcharacterGoals for.
goals_againstcharacterGoals against.
goals_diffcharacterGoal differential, goals_for minus goals_against (feed header 'Goal Differential'), as a signed integer string such as '14' or '-10'.
percentagecharacterPoints percentage (feed header 'Percentage'): points earned divided by the maximum points available from games played, as a three-decimal string, e.g. '0.833' for 5 of 6 possible points; '0.000' before a team has played.
games_playedcharacterGames played.
team_rankintegerTeam rank in the standings.
teamcharacterTeam-side label or team identifier.

mjhl_team_roster​

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

MJHL team roster for a given team + season.

Parameters

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

mjhl_teams​

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

MJHL teams for a given season.

Parameters

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

Returns

col_nametypedescription
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_idcharacterUnique team identifier.
team_codecharacterInternal team code.
team_nicknamecharacterTeam nickname.
team_labelcharacterShort city label.
divisioncharacterTeam division.
team_logocharacterTeam logo image URL.