gamesheet_sdk.admin.roster.players module

Player roster operations.

gamesheet_sdk.admin.roster.players.assign_player(session, season_id, player_id, team_id, *, jersey=None, position=None, status=None, designation=None)[source]

Assign an existing player to a team’s roster.

The supplied Session must already carry a bearer token (e.g. via Session.set_bearer_token()); the call is otherwise unauthenticated and will 401.

Parameters:
  • session (Session) – An authenticated Session.

  • season_id (str) – The season identifier.

  • player_id (str) – The player identifier to assign.

  • team_id (str) – The team identifier to assign the player to.

  • jersey (str | None) – Optional jersey number.

  • position (str | None) – Optional position (Forward, Defence, Goalie, etc.).

  • status (str | None) – Optional status (Regular, Affiliated, etc.).

  • designation (str | None) – Optional designation (Captain, Alternate Captain, etc.).

Returns:

Player – The Player with roster metadata populated.

Raises:

GameSheetError – If the player is already assigned to the team.

Return type:

Player

gamesheet_sdk.admin.roster.players.create_player(session, season_id, first_name, last_name, *, external_id=None, jersey=None, position=None, status=None, designation=None, team_id=None, biography=None, height=None, weight=None, shot_hand=None, birthdate=None, hometown=None, country=None, province=None, drafted_by=None, committed_to=None, photo_path=None)[source]

Create a new player in the specified season.

The supplied Session must already carry a bearer token (e.g. via Session.set_bearer_token()); the call is otherwise unauthenticated and will 401.

Parameters:
  • session (Session) – An authenticated Session.

  • season_id (str) – The season identifier to create the player in.

  • first_name (str) – Player’s first name.

  • last_name (str) – Player’s last name.

  • external_id (str | None) – Optional external identifier for the player.

  • jersey (str | None) – Optional jersey number.

  • position (str | None) – Optional position (Forward, Defence, Goalie, etc.).

  • status (str | None) – Optional status (Regular, Affiliated, etc.).

  • designation (str | None) – Optional designation (Captain, Alternate Captain, etc.).

  • team_id (str | None) – Optional team identifier to associate the player with.

  • biography (str | None) – Optional biography text.

  • height (str | None) – Optional height (e.g., “6’2"”).

  • weight (str | None) – Optional weight (e.g., “185”).

  • shot_hand (str | None) – Optional shooting hand (left, right).

  • birthdate (str | None) – Optional birthdate (ISO format: YYYY-MM-DD).

  • hometown (str | None) – Optional hometown.

  • country (str | None) – Optional country code (e.g., “US”, “CA”).

  • province (str | None) – Optional province/state.

  • drafted_by (str | None) – Optional drafted by team name.

  • committed_to (str | None) – Optional committed to institution.

  • photo_path (str | None) – Optional path to a local photo image file.

Returns:

Player – The newly created Player model instance.

Return type:

Player

gamesheet_sdk.admin.roster.players.delete_player(session, season_id, player_id)[source]

Delete a player from the specified season.

The supplied Session must already carry a bearer token (e.g. via Session.set_bearer_token()); the call is otherwise unauthenticated and will 401.

Parameters:
  • session (Session) – An authenticated Session.

  • season_id (str) – The season identifier containing the player.

  • player_id (str) – The player identifier to delete.

gamesheet_sdk.admin.roster.players.get_player(session, season_id, player_id)[source]

Get a single player by ID.

The supplied Session must already carry a bearer token (e.g. via Session.set_bearer_token()); the call is otherwise unauthenticated and will 401.

Parameters:
  • session (Session) – An authenticated Session.

  • season_id (str) – The parent season identifier.

  • player_id (str) – The player identifier to retrieve.

Returns:

Player – The requested Player model instance.

Return type:

Player

gamesheet_sdk.admin.roster.players.get_player_penalty_report(session, season_id, player_id)[source]

Fetch penalty report for a player.

First retrieves the player to get their external_id, then fetches the penalty report from the BFF API. The supplied Session must already carry a bearer token (e.g. via Session.set_bearer_token()); the call is otherwise unauthenticated and will 401.

Parameters:
  • session (Session) – An authenticated Session.

  • season_id (str) – The season identifier.

  • player_id (str) – The player identifier.

Returns:

dict[str, Any]

Penalty report data including player_games, player_penalties, rostered_players, and

season_players.

Raises:

GameSheetError – If the penalty report API returns a non-success status.

Return type:

dict[str, Any]

gamesheet_sdk.admin.roster.players.list_players(session, season_id)[source]

Return every player in the specified season.

The supplied Session must already carry a bearer token (e.g. via Session.set_bearer_token()); the call is otherwise unauthenticated and will 401.

Parameters:
  • session (Session) – An authenticated Session.

  • season_id (str) – The season identifier whose players to list.

Returns:

list[Player]

A list of Player, in the order the server returned them. The list may be empty

if the season has no players.

Return type:

list[Player]

gamesheet_sdk.admin.roster.players.unassign_player(session, season_id, player_id, team_id)[source]

Unassign a player from a team’s roster.

The supplied Session must already carry a bearer token (e.g. via Session.set_bearer_token()); the call is otherwise unauthenticated and will 401.

Parameters:
  • session (Session) – An authenticated Session.

  • season_id (str) – The season identifier.

  • player_id (str) – The player identifier to unassign.

  • team_id (str) – The team identifier to unassign the player from.

Raises:

GameSheetError – If the player is not assigned to the team.

gamesheet_sdk.admin.roster.players.update_player(session, season_id, player_id, *, first_name=None, last_name=None, external_id=None, biography=None, height=None, weight=None, shot_hand=None, birthdate=None, hometown=None, country=None, province=None, drafted_by=None, committed_to=None, photo_path=None, remove_photo=False)[source]

Update an existing player in the specified season.

The supplied Session must already carry a bearer token (e.g. via Session.set_bearer_token()); the call is otherwise unauthenticated and will 401. At least one field must be provided for update.

Parameters:
  • session (Session) – An authenticated Session.

  • season_id (str) – The season identifier containing the player.

  • player_id (str) – The player identifier to update.

  • first_name (str | None) – Optional updated first name.

  • last_name (str | None) – Optional updated last name.

  • external_id (str | None) – Optional updated external identifier.

  • biography (str | None) – Optional updated biography text.

  • height (str | None) – Optional updated height (e.g., “6’2"”).

  • weight (str | None) – Optional updated weight (e.g., “185”).

  • shot_hand (str | None) – Optional updated shooting hand (left, right).

  • birthdate (str | None) – Optional updated birthdate (ISO format: YYYY-MM-DD).

  • hometown (str | None) – Optional updated hometown.

  • country (str | None) – Optional updated country code (e.g., “US”, “CA”).

  • province (str | None) – Optional updated province/state.

  • drafted_by (str | None) – Optional updated drafted by team name.

  • committed_to (str | None) – Optional updated committed to institution.

  • photo_path (str | None) – Optional path to a new photo image file.

  • remove_photo (bool) – If True, remove the player’s photo.

Returns:

Player – The updated Player.

Return type:

Player