gamesheet_sdk.teams.schedule.create module

Creation functions and helpers for events, games, and practices.

gamesheet_sdk.teams.schedule.create.build_rrule(frequency, *, interval=1, by_day=None, until=None)[source]

Build an RRULE string for recurring events.

Parameters:
  • frequency (str | None) – Recurrence frequency (‘daily’, ‘weekly’, ‘monthly’).

  • interval (int) – Recurrence interval in units of frequency (default: 1).

  • by_day (str | list[str] | None) – Days of week for weekly recurrence (e.g., ‘TU,TH’, ‘mon,wed’).

  • until (str | None) – Recurrence end date (e.g. ‘2026-11-28’ or ‘20261128T235959Z’, default: None).

Returns:

str | None – Formatted RRULE string or None if frequency is not specified.

Raises:

GameSheetError – If frequency is not recognized.

Return type:

str | None

gamesheet_sdk.teams.schedule.create.create_calendar_event_raw(session, payload, *, timeout=15.0)[source]

Create a calendar event or practice via POST /api/calendar/events.

Parameters:
Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.schedule.create.create_event(session, team_id, title, start_date_time, end_time, *, event_type='event', timezone=None, location='', notes='', all_day=False, rrule=None, repeat_until=None, timeout=15.0)[source]

Create a calendar event (‘event’ or ‘practice’ type).

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str | int) – Team identifier (prototeam ID or team ID).

  • title (str) – Event title.

  • start_date_time (str) – Start date/time (e.g. ‘2026-08-21T13:30’).

  • end_time (str) – End time (e.g. ‘14:30’).

  • event_type (str) – Event type (‘event’ or ‘practice’, default: ‘event’).

  • timezone (str | None) – Timezone name (defaults to local timezone).

  • location (str) – Venue or location address (default: empty string).

  • notes (str) – Event notes or description (default: empty string).

  • all_day (bool) – Whether event is all day (default: False).

  • rrule (str | None) – Recurrence rule (default: None).

  • repeat_until (str | None) – Recurrence end date (e.g. ‘2027-03-22’, default: None).

  • timeout (float) – Request timeout in seconds.

Returns:

CalendarEventCreated – Created event details model.

Raises:

GameSheetError – If the server returns malformed data.

Return type:

CalendarEventCreated

gamesheet_sdk.teams.schedule.create.create_game(session, team_id, season_id, division_id, opposing_team_id, date_time, end_time, *, home_flag=True, opposing_division=None, association_id=0, league_id=0, game_number='', game_type='regular_season', location='', scorekeeper_name='', scorekeeper_phone='', broadcast_provider='', time_zone_name=None, time_zone_offset=None, timeout=15.0)[source]

Create a scheduled game via the teams schedule-game endpoint.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (int | str) – Team identifier.

  • season_id (int | str) – Season identifier.

  • division_id (int | str) – Division identifier.

  • opposing_team_id (int | str) – Opposing team identifier.

  • date_time (str) – Start date/time (e.g. ‘2026-08-20T12:00’).

  • end_time (str) – End time (e.g. ‘13:15’).

  • home_flag (bool) – Whether the team is the home team (default: True).

  • opposing_division (int | str | None) – Opposing team division (default: same as division_id).

  • association_id (int | str) – Parent association identifier (default: 0).

  • league_id (int | str) – Parent league identifier (default: 0).

  • game_number (str) – Game number / identifier (default: ‘’).

  • game_type (str) – Game type (default: ‘regular_season’). Must be a valid game type.

  • location (str) – Game venue / location (default: ‘’).

  • scorekeeper_name (str) – Scorekeeper full name (default: ‘’).

  • scorekeeper_phone (str) – Scorekeeper phone number (default: ‘’).

  • broadcast_provider (str) – Broadcast provider key (default: ‘’).

  • time_zone_name (str | None) – IANA time zone name (defaults to local timezone).

  • time_zone_offset (int | None) – Time zone offset in minutes (defaults to local offset).

  • timeout (float) – Request timeout in seconds.

Returns:

CreatedGameResult – Result containing game creation details and status.

Return type:

CreatedGameResult

gamesheet_sdk.teams.schedule.create.create_practice(session, team_id, start_date_time, end_time, *, title='Practice', timezone=None, location='', notes='', all_day=False, rrule=None, repeat_until=None, timeout=15.0)[source]

Create a practice calendar event (‘practice’ type).

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str | int) – Team identifier (prototeam ID or team ID).

  • start_date_time (str) – Start date/time (e.g. ‘2026-08-30T13:30’).

  • end_time (str) – End time (e.g. ‘14:30’).

  • title (str) – Practice title (default: ‘Practice’).

  • timezone (str | None) – Timezone name (defaults to local timezone).

  • location (str) – Venue or location address (default: empty string).

  • notes (str) – Notes or description (default: empty string).

  • all_day (bool) – Whether practice is all day (default: False).

  • rrule (str | None) – Recurrence rule (default: None).

  • repeat_until (str | None) – Recurrence end date (default: None).

  • timeout (float) – Request timeout in seconds.

Returns:

CalendarEventCreated – Created practice details model.

Return type:

CalendarEventCreated

gamesheet_sdk.teams.schedule.create.create_schedule_game_raw(session, payload, *, timeout=15.0)[source]

Create a scheduled game via POST /api/schedule-game.

Parameters:
Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.schedule.create.validate_game_type(game_type)[source]

Validate a game type against known valid types.

Parameters:

game_type (str) – The game type to validate.

Raises:

GameSheetError – If the game type is not valid.