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
Sessionmust already carry a bearer token (e.g. viaSession.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
Playerwith roster metadata populated.- Raises:
GameSheetError – If the player is already assigned to the team.
- Return type:
- 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
Sessionmust already carry a bearer token (e.g. viaSession.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:
- gamesheet_sdk.admin.roster.players.delete_player(session, season_id, player_id)[source]¶
Delete a player from the specified season.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.
- gamesheet_sdk.admin.roster.players.get_player(session, season_id, player_id)[source]¶
Get a single player by ID.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.
- 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
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- 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:
- gamesheet_sdk.admin.roster.players.list_players(session, season_id)[source]¶
Return every player in the specified season.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.
- 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
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- 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
Sessionmust already carry a bearer token (e.g. viaSession.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: