Skip to content

Games

Game-related functionality in Edgework.

Game Events

edgework.models.game_events.GameEvent(edgework_client, obj_id=None, **kwargs)

Bases: BaseNHLModel

GameEvent model to store game event information.

Initialize a GameEvent object with dynamic attributes.

Parameters:

Name Type Description Default
edgework_client

The Edgework client

required
obj_id

The ID of the event

None
**kwargs

Dynamic attributes for game event properties

{}

fetch_data()

Fetch the data for the game event.

edgework.models.game_events.GameLog(edgework_client, obj_id=None, game_id=None, season=None, date=None, events=None)

Bases: BaseNHLModel

GameLog model to store game log information.

Initialize a GameLog object.

Parameters:

Name Type Description Default
edgework_client

The Edgework client

required
obj_id

The ID of the game log

None
game_id

Game ID is the unique identifier for the game

None
season

Season is the season the game was played in

None
date

Date is the date the game was played

None
events

Events is a list of GameEvent objects that occurred in the game

None

fetch_data()

Fetch the data for the game log.

Game Client

edgework.clients.game_client.GameClient(client)

Client for fetching NHL game data.

get_game(game_id)

Fetch game boxscore data.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required

Returns:

Type Description
Game

Game object with boxscore data.

get_play_by_play(game_id)

Fetch play-by-play data for a game.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required

Returns:

Type Description
PlayByPlay

PlayByPlay object with full play-by-play data.

get_game_landing(game_id)

Fetch game landing page data.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required

Returns:

Type Description
Dict

Dictionary with comprehensive game landing data.

get_game_boxscore(game_id)

Fetch game boxscore data as raw dictionary.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required

Returns:

Type Description
Dict

Dictionary with boxscore data.

get_game_story(game_id)

Fetch game story/narrative data.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required

Returns:

Type Description
Dict

Dictionary with game story data.

get_game_right_rail(game_id)

Fetch game right rail data.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required

Returns:

Type Description
Dict

Dictionary with right rail game information.

get_score(date=None)

Fetch score data for a specific date or current scores.

Parameters:

Name Type Description Default
date Optional[Union[datetime, str]]

Date for scores. If None, fetches current scores. Can be datetime object or string in YYYY-MM-DD format.

None

Returns:

Type Description
Dict

Dictionary with score data for the specified date.

get_scoreboard()

Fetch current scoreboard data.

Returns:

Type Description
Dict

Dictionary with current scoreboard information.

get_goal_replay(game_id, event_number)

Fetch goal replay information for a specific game event.

Targets the documented /ppt-replay/goal/{game-id}/{event-number} route.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required
event_number int

The event number within the game.

required

Returns:

Type Description
Dict

Dictionary with goal replay information.

get_play_replay(game_id, event_number)

Fetch replay information for a specific game event.

Targets the documented /ppt-replay/{game-id}/{event-number} route.

Delegation note: following goal.pptReplayUrl from this metadata to the actual tracking frames lives in :meth:edgework.clients.edge_client.EdgeClient.get_goal_frames (the sprites host needs a Referer header); this method stays the metadata-only owner of the route.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required
event_number int

The event number within the game.

required

Returns:

Type Description
Dict

Dictionary with play replay information.

get_wsc_play_by_play(game_id)

Fetch WSC play-by-play data for a game.

Targets the documented /wsc/play-by-play/{game-id} route, which is distinct from the gamecenter play-by-play route used by :meth:get_play_by_play.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required

Returns:

Type Description
Dict

Dictionary with WSC play-by-play data.

get_partner_game_odds(country_code='US')

Fetch odds for games in a specific country as of the current moment.

Targets the documented /partner-game/{country-code}/now route.

Note

This is the documented odds endpoint and is NOT the /where-to-watch streaming endpoint (see NetworkClient.get_where_to_watch for that route).

Parameters:

Name Type Description Default
country_code str

Country code for odds info (default: "US").

'US'

Returns:

Type Description
Dict

Dictionary with partner game odds information.

get_where_to_watch(country_code='US')

Deprecated alias for :meth:get_partner_game_odds.

This method has always fetched partner-game odds from /partner-game/{country-code}/now; it does NOT request the real /where-to-watch streaming endpoint. Use :meth:get_partner_game_odds (or NetworkClient.get_where_to_watch for the actual streaming route) instead.

Parameters:

Name Type Description Default
country_code str

Country code for odds info (default: "US").

'US'

Returns:

Type Description
Dict

Dictionary with partner game odds information.

get_shifts(game_id)

Fetch shift data for a game.

Delegates to the canonical :class:ShiftClient wrapper for the documented /{lang}/shiftcharts route.

Parameters:

Name Type Description Default
game_id int

The NHL game ID.

required

Returns:

Type Description
List[Shift]

List of Shift objects.

get_games_for_date(date)

Fetch all games for a specific date.

Parameters:

Name Type Description Default
date Union[datetime, str]

Date to fetch games for. Can be datetime or YYYY-MM-DD string.

required

Returns:

Type Description
List[Game]

List of Game objects for that date.

get_current_games()

Fetch all current/upcoming games.

Returns:

Type Description
List[Game]

List of Game objects for current games.