gamesheet_sdk.admin.roster.team_players module¶
Team-scoped player roster operations.
- gamesheet_sdk.admin.roster.team_players.assign_team_player(session, season_id, team_id, player_id, *, jersey=None, position=None, status=None, designation=None)[source]¶
Assign an existing player to a team’s roster (team-scoped alias).
This is an alias for
assign_player()provided for consistency with the team-scoped command structure. The suppliedSessionmust 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.
team_id (str) – The team identifier to assign the player to.
player_id (str) – The player identifier to assign.
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.- Return type:
- gamesheet_sdk.admin.roster.team_players.create_team_player(session, season_id, team_id, first_name, last_name, *, external_id=None, jersey=None, position=None, status=None, designation=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 and add to the specified team’s roster.
This function performs two operations: (1) creates the player at the season level, (2) updates the team’s roster to include the new player with position and other metadata. 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.
team_id (str) – The team identifier to add the player to.
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.).
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 with roster metadata populated.
- Return type:
- gamesheet_sdk.admin.roster.team_players.delete_team_player(session, season_id, team_id, player_id)[source]¶
Delete a player from a team’s roster and the season.
This function performs two operations: (1) removes the player from the team’s roster, (2) deletes the player at the season level. 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.team_players.get_team_player(session, season_id, team_id, player_id)[source]¶
Get a single player from a team’s roster.
This function retrieves team roster metadata (number, position, status, etc.) that is only available in the team context, unlike
get_player()which fetches from the season-level players endpoint without roster metadata. The suppliedSessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Returns:
Player – The
Playerwith team roster metadata populated.- Raises:
GameSheetError – If the player is not found on the team’s roster.
- Return type:
- gamesheet_sdk.admin.roster.team_players.list_team_players(session, season_id, team_id)[source]¶
Return every player for the specified team.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Returns:
list[Player] –
- A list of
Player, in the order the server returned them. The list may be empty if the team has no players.
- A list of
- Return type:
- gamesheet_sdk.admin.roster.team_players.unassign_team_player(session, season_id, team_id, player_id)[source]¶
Unassign a player from a team’s roster (team-scoped alias).
This is an alias for
unassign_player()provided for consistency with the team-scoped command structure. The suppliedSessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.
- gamesheet_sdk.admin.roster.team_players.update_team_player(session, season_id, team_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 a player for a specific team.
This function updates the player at the season level. 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.
team_id (str) – The team identifier.
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: