Skip to main content
Version: 0.1.5

OHL — additional Python functions

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

HockeyTech / LeagueStat​

ohl_game_corsi​

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

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

Parameters

ParameterTypeDefaultDescription
game_idintThe HockeyTech game id.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per player on ice for a shot attempt: player_id (String), corsi_for / corsi_against / corsi_for_pct, fenwick_for / fenwick_against / fenwick_for_pct, corsi_includes_missed (Boolean), toi_seconds (Int64) and corsi_for_per60 (Float64, null without time on ice). A pandas DataFrame when return_as_pandas is True.

col_nametypedescription
player_idcharacterUnique player identifier.
corsi_forintegerTotal shot attempts (goals, saves, missed shots, and blocked shots) directed toward the opposing team while the player was on the ice in the OHL game.
corsi_againstintegerTotal shot attempts (goals, saves, missed shots, and blocked shots) directed against the player's team while that player was on the ice in the OHL game.
corsi_for_pctdoubleShare of all shot attempts while the player was on the ice that were directed toward the opponent, expressed as a percentage (Corsi For / (Corsi For + Corsi Against)).
fenwick_forintegerUnblocked shot attempts (goals, saves, and missed shots only) directed toward the opposing team while the player was on the ice.
fenwick_againstintegerUnblocked shot attempts (goals, saves, and missed shots only) directed against the player's team while that player was on the ice.
fenwick_for_pctdoubleShare of all unblocked shot attempts while the player was on the ice that were directed toward the opponent, expressed as a percentage (Fenwick For / (Fenwick For + Fenwick Against)).
corsi_includes_missedlogicalBoolean flag indicating whether missed shots are included in the Corsi totals for this record.
toi_secondsintegerTotal time on ice for the player during the game, recorded in seconds.
corsi_for_per60doubleThe player's Corsi For rate normalized to a 60-minute pace, enabling comparison across players with different ice times.

ohl_game_shifts​

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

Parsed shift stints for a single OHL game.

Parameters

ParameterTypeDefaultDescription
game_idintThe HockeyTech game id.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per shift: game_id and player_id (Int64), first_name, last_name, jersey_number, home (Int64, 1 = home), period, start_time / end_time / length (clock strings), start_s / end_s (Int64 seconds) and the goal_on_shift / penalty_on_shift flags. A pandas DataFrame when return_as_pandas is True.

ohl_game_summary​

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

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

Parameters

ParameterTypeDefaultDescription
game_idintThe HockeyTech game id.

Returns

game (one row: game_id, date, status, venue, attendance, both teams and scores), goals (one row per goal with the scorer, both assists and the plus / minus skaters), penalties (one row per penalty), shots_by_period (side, period, shots) and three_stars. When the league denies the summary view, the event frames are empty and game is a game_id stub row.

ohl_leaders​

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

OHL statistical leaders for a given season.

Parameters

ParameterTypeDefaultDescription
seasonOptional[int]NoneSeason as an END year (2026 = the 2025-26 season). Defaults to the newest regular season when neither season nor season_id is given.
season_idOptional[int]NoneThe HockeyTech season id, when it is already known.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per ranked skater (points and goals leaders): rank (Int64), player_id, name, jersey_number, position, team_id / team_name / team_code, stat_formatted and type_formatted (String), plus photo and logo URLs. A pandas DataFrame when return_as_pandas is True.

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_smallcharacterURL of the small-format team logo image for the player's OHL club.
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_formattedcharacterHuman-readable label describing the statistical category for which the player appears on the leaders list (e.g., 'Points', 'Goals', 'Save Percentage').
photocharacterURL to the player photo.
photo_smallcharacterURL of a small-format headshot image of the player from the OHL HockeyTech feed.
positioncharacterPlayer position.
divisioncharacterDivision identifier.

ohl_pbp​

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

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

Parameters

ParameterTypeDefaultDescription
game_idintThe HockeyTech game id.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per event (shot, goal, penalty, faceoff, hit, goalie change ...): game_id, event, team_id, period_of_game, time_of_period, rink x_coord / y_coord (Float64, hockeytech_b canvas), the primary / second / third player and goalie ids and names, the plus / minus skaters on a goal, game metadata from the game summary, and derived shot_distance / shot_angle / scoring_chance and the on_ice_home / on_ice_away skaters from the shift feed. Player ids are Float64 here. Some leagues (USHL, MJHL) publish only goals, penalties and goalie changes, with no coordinates. A pandas DataFrame when return_as_pandas is True.

col_nametypedescription
game_idintegerUnique game identifier.
eventcharacterEvent description label.
team_idcharacterUnique team identifier.
period_of_gamecharacterPeriod in which the event occurred.
time_of_periodcharacterElapsed time within the period (MM:SS).
x_coorddoubleTransformed x-coordinate of the event (feet scale).
y_coorddoubleTransformed y-coordinate of the event (feet scale).
player_iddoubleUnique player identifier.
player_name_firstcharacterPrimary player first name.
player_name_lastcharacterPrimary player last name.
player_positioncharacterPrimary player position.
goallogicalFlag for whether the event was a goal.
is_goal_twinlogicalBoolean flag marking a shot row that duplicates a goal event on the same play — the HockeyTech feed emits both a shot row and a goal row for every goal. Shot rows (twins included) match the official boxscore shots-on-goal totals; drop rows with this flag set to get a deduplicated event stream.
goalie_iddoubleGoalie identifier on the play.
goalie_firstcharacterGoalie first name.
goalie_lastcharacterGoalie last name.
home_wincharacterWhether the home player won the faceoff.
player_team_idcharacterUnique team identifier of the primary player.
event_typecharacterStandardized event type code.
shot_qualitycharacterShot quality descriptor.
player_two_iddoubleSecond player's unique identifier.
player_two_name_firstcharacterSecond player first name.
player_two_name_lastcharacterSecond player last name.
player_two_positioncharacterSecond player position.
penalty_lengthcharacterPenalty length in minutes.
power_playcharacterWhether the event occurred on a power play.
empty_netcharacterWhether the net was empty.
game_winnercharacterWhether the goal was the game-winning goal.
penalty_shotcharacterWhether the goal came on a penalty shot.
insurancecharacterWhether the goal was an insurance goal.
short_handedcharacterWhether the event occurred while short-handed.
player_three_iddoubleThird player's unique identifier.
player_three_name_firstcharacterThird player first name.
player_three_name_lastcharacterThird player last name.
player_three_positioncharacterThird player position.
plus_player_one_iddoubleOn-ice plus player one unique identifier.
plus_player_one_firstcharacterOn-ice plus player one first name.
plus_player_one_lastcharacterOn-ice plus player one last name.
plus_player_one_positioncharacterOn-ice plus player one position.
plus_player_two_iddoubleOn-ice plus player two unique identifier.
plus_player_two_firstcharacterOn-ice plus player two first name.
plus_player_two_lastcharacterOn-ice plus player two last name.
plus_player_two_positioncharacterOn-ice plus player two position.
plus_player_three_iddoubleOn-ice plus player three unique identifier.
plus_player_three_firstcharacterOn-ice plus player three first name.
plus_player_three_lastcharacterOn-ice plus player three last name.
plus_player_three_positioncharacterOn-ice plus player three position.
plus_player_four_iddoubleOn-ice plus player four unique identifier.
plus_player_four_firstcharacterOn-ice plus player four first name.
plus_player_four_lastcharacterOn-ice plus player four last name.
plus_player_four_positioncharacterOn-ice plus player four position.
plus_player_five_iddoubleOn-ice plus player five unique identifier.
plus_player_five_firstcharacterOn-ice plus player five first name.
plus_player_five_lastcharacterOn-ice plus player five last name.
plus_player_five_positioncharacterOn-ice plus player five position.
minus_player_one_iddoubleOn-ice minus player one unique identifier.
minus_player_one_firstcharacterOn-ice minus player one first name.
minus_player_one_lastcharacterOn-ice minus player one last name.
minus_player_one_positioncharacterOn-ice minus player one position.
minus_player_two_iddoubleOn-ice minus player two unique identifier.
minus_player_two_firstcharacterOn-ice minus player two first name.
minus_player_two_lastcharacterOn-ice minus player two last name.
minus_player_two_positioncharacterOn-ice minus player two position.
minus_player_three_iddoubleOn-ice minus player three unique identifier.
minus_player_three_firstcharacterOn-ice minus player three first name.
minus_player_three_lastcharacterOn-ice minus player three last name.
minus_player_three_positioncharacterOn-ice minus player three position.
minus_player_four_iddoubleOn-ice minus player four unique identifier.
minus_player_four_firstcharacterOn-ice minus player four first name.
minus_player_four_lastcharacterOn-ice minus player four last name.
minus_player_four_positioncharacterOn-ice minus player four position.
minus_player_five_iddoubleOn-ice minus player five unique identifier.
minus_player_five_firstcharacterOn-ice minus player five first name.
minus_player_five_lastcharacterOn-ice minus player five last name.
minus_player_five_positioncharacterOn-ice minus player five position.
game_datecharacterGame date.
game_seasonintegerSeason (concluding year, YYYY).
game_season_idcharacterHockeyTech season identifier.
home_teamcharacterHome team name.
home_team_idcharacterHome team identifier.
away_teamcharacterAway team name.
away_team_idcharacterAway team identifier.
x_coord_originaldoubleOriginal raw x-coordinate from the feed.
y_coord_originaldoubleOriginal raw y-coordinate from the feed.
x_coord_neutraldoubleNeutral-zone-centered x-coordinate.
y_coord_neutraldoubleNeutral-zone-centered y-coordinate.
x_coord_fixeddoubleFixed-orientation x-coordinate.
y_coord_fixeddoubleFixed-orientation y-coordinate.
x_coord_rightdoubleRight-orientation x-coordinate.
y_coord_rightdoubleRight-orientation y-coordinate.
x_coord_verticaldoubleVertical-orientation x-coordinate.
y_coord_verticaldoubleVertical-orientation y-coordinate.
minute_startintegerMinute mark of the period when the event started.
second_startintegerSecond mark of the period when the event started.
clockcharacterGame clock time remaining (MM:SS).
sec_from_startintegerSeconds elapsed since the start of the game.
shot_distancedoubleDistance of the shot from the net.
shot_angledoubleAngle of the shot relative to the net.
scoring_chancelogicalBoolean flag indicating whether this play was classified as a scoring chance by the HockeyTech data feed.
on_ice_homecharacterJersey numbers or player IDs of home-team skaters on the ice at the time of this play.
on_ice_awaycharacterJersey numbers or player IDs of away-team skaters on the ice at the time of this play.

ohl_player_stats​

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

OHL player season stats across all seasons.

Parameters

ParameterTypeDefaultDescription
player_idintThe HockeyTech player id.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per season (and team) the player played: season_id, season_name, playoff, team_id / team_name / team_code, games_played, goals, assists, points, plus_minus, penalty_minutes, power-play / short-handed / shootout splits, shots, faceoff_wins / faceoff_attempts, ice_time and stat_type (String, as the feed ships them). A pandas DataFrame when return_as_pandas is True.

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_faceoffscharacterFlag indicating whether faceoff tracking is enabled for this player's statistical record in the HockeyTech system.
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.
shots_oncharacterShots on goal count.
shots_widecharacterCount of shot attempts by the player that missed the net wide, as tracked by OHL shot-location data.
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").

ohl_player_toi​

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

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

Parameters

ParameterTypeDefaultDescription
game_idintThe HockeyTech game id.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per player: player_id (Int64), first_name, last_name, toi_seconds (Int64), num_shifts and avg_shift_s (Float64). A pandas DataFrame when return_as_pandas is True.

col_nametypedescription
player_idintegerUnique player identifier.
first_namecharacterPlayer first name.
last_namecharacterPlayer last name.
toi_secondsintegerTotal time on ice for the player during the game or tracked period, expressed in seconds.
num_shiftsintegerTotal number of shifts the player took during the game or tracked period.
avg_shift_sdoubleAverage duration of the player's individual shifts during the game or season, measured in seconds.

ohl_schedule​

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

OHL schedule — one row per game.

Parameters

ParameterTypeDefaultDescription
seasonOptional[int]NoneSeason as an END year (2026 = the 2025-26 season). With neither season nor season_id, no season filter is sent and the feed's whole recent window comes back.
season_idOptional[int]NoneThe HockeyTech season id, when it is already known.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per game: game_id, game_date, game_status, home_team / home_team_id / home_score, away_team / away_team_id / away_score, venue, season_id and game_type (all String). With no season given, the feed's whole recent window. A pandas DataFrame when return_as_pandas is True.

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.

ohl_standings​

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

OHL standings — one row per team.

Parameters

ParameterTypeDefaultDescription
seasonOptional[int]NoneSeason as an END year (2026 = the 2025-26 season). Defaults to the newest regular season when neither season nor season_id is given.
season_idOptional[int]NoneThe HockeyTech season id, when it is already known.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per team: team, team_code, team_rank and wins (Int64), and games_played, losses, regulation_wins, non_reg_wins, non_reg_losses, points, goals_for, goals_against, games_remaining, percentage and overall_rank (String, as the feed ships them). A pandas DataFrame when return_as_pandas is True.

col_nametypedescription
team_codecharacterTeam abbreviation.
winscharacterWins.
lossescharacterLosses.
ot_lossescharacterOvertime losses.
ot_winscharacterOvertime wins.
shootout_winscharacterShootout wins.
shootout_lossescharacterShootout losses.
regulation_winscharacterWins in regulation.
rowcharacter
pointsintegerTotal points (goals + assists).
penalty_minutescharacterPenalty minutes.
streakcharacterCurrent streak value.
goals_forcharacterGoals for.
goals_againstcharacterGoals against.
goals_diffcharacterNet goal differential for the team (goals for minus goals against) displayed as a signed string.
percentagecharacterTeam points percentage expressed as a string, calculated as points earned divided by maximum possible points.
overall_rankcharacter
games_playedcharacterGames played.
team_rankintegerTeam rank in the standings.
past_10characterRecord over the team's most recent 10 games (feed header 'Past 10 Games') as a hyphenated string: W-L-OTL-SOL when four parts are shipped (e.g. '2-0-0-1'), W-L-OTL when three are (e.g. '0-2-1').
teamcharacterTeam name.

ohl_team_roster​

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

OHL team roster for a given team + season.

Parameters

ParameterTypeDefaultDescription
team_idintThe HockeyTech team id.
seasonOptional[int]NoneSeason as an END year (2026 = the 2025-26 season). Defaults to the newest regular season when neither season nor season_id is given.
season_idOptional[int]NoneThe HockeyTech season id, when it is already known.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per rostered player: player_id, person_id, names (first_name, last_name, display_name), position, tp_jersey_number, shoots / catches, height / weight, birthdate, home and birth places, rookie, veteran_status, draft_status and player_image (String, as the feed ships them). A pandas DataFrame when return_as_pandas is True.

ohl_teams​

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

OHL teams for a given season.

Parameters

ParameterTypeDefaultDescription
seasonOptional[int]NoneSeason as an END year (2026 = the 2025-26 season). Defaults to the newest regular season when neither season nor season_id is given.
season_idOptional[int]NoneThe HockeyTech season id, when it is already known.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per team: team_id, team_name, team_code, team_nickname, team_label, division and team_logo (String). A pandas DataFrame when return_as_pandas is True.

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.

Dates and seasons​

most_recent_ohl_season​

most_recent_ohl_season() -> 'int'

Newest OHL regular season as an end-year integer: the highest season_yr of a regular season that is not a one-off event, so a preseason listed first is not a default.

Returns

The newest regular season's END year (2026 = the 2025-26 season).

ohl_season_id​

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

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

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per season: season_id (Int64), season_name, season_short, career, playoff, start_date, end_date, season_yr (Int64, the END year) and game_type_label. A pandas DataFrame when return_as_pandas is True.

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_yrintegerEnd year of the season the row belongs to, read from its name: "2025-26", "2025/26" and "2025-2026" are 2026, "26-27" is 2027, a compact "2425" is 2025. A preseason or exhibition named with the one year it starts in belongs to the next season ("2026 Pre-season" is 2027). Null when the name holds no year.
game_type_labelcharacterGame type read from the season name, first match wins: "preseason" (pre-season, preseason), "playoffs" (playoff, post), "exhibition", else "regular". One-off events such as all-star games are labelled "regular" too; season resolution skips them.