Models

Pydantic data models exposed by lptk.

Team & player

class lptk.Player

Bases: BaseModel

A tournament participant/player.

player_id

Internal start.gg participant ID.

player_tag

Player’s in-game name/gamertag.

player_country

ISO 3166-1 alpha-2 country code (lowercase, e.g., “fr”, “us”).

player_id: int | None
player_tag: str
player_country: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class lptk.Team

Bases: BaseModel

A tournament team/entrant with placement and roster.

placement

Current standing/placement in the tournament (1 = winner).

team_name

Display name of the team (None for empty placeholders).

members

List of players on the team roster.

entrant_id

Internal start.gg entrant ID for API lookups.

elimination_set_id

ID of the set where the team was eliminated.

bracket_group

Bracket group identifier (e.g., “B1”, “B2”).

bracket_identifier

Match identifier within the bracket (e.g., “AL”, “AM”).

source_phase

Name of the phase this team was collected from.

phase_type

Type of phase (finals, playoffs, swiss, pools).

pool_group

Pool/group identifier for earlier stages.

pool_placement

Placement within the pool/group.

pool_number

Numeric pool identifier for sorting.

placement: int
team_name: str | None
members: list[Player]
entrant_id: int | None
elimination_set_id: int | None
bracket_group: str | None
bracket_identifier: str | None
source_phase: str | None
phase_type: str | None
pool_group: str | None
pool_placement: int | None
pool_number: int | None
property is_placeholder: bool

Check if this is an empty placeholder entry.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Tournament structure

class lptk.Phase

Bases: BaseModel

A tournament phase (stage) containing one or more phase groups.

id

Internal start.gg phase ID.

name

Display name of the phase (e.g., “Day 2”, “Playoffs”).

state

Phase state (1=CREATED, 2=ACTIVE, 3=COMPLETED).

num_seeds

Total number of entrants in this phase.

groups

List of phase groups within this phase.

id: int
name: str
state: int | str
num_seeds: int
groups: list[PhaseGroup]
property is_completed: bool

Check if the phase has completed.

property is_active: bool

Check if the phase is currently active.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class lptk.PhaseGroup

Bases: BaseModel

A phase group (bracket/pool) within a tournament phase.

id

Internal start.gg phase group ID.

identifier

Display identifier (e.g., “B1”, “Pool A”).

state

Phase group state (1=CREATED, 2=ACTIVE, 3=COMPLETED).

num_seeds

Number of entrants seeded into this group.

id: int
identifier: str
state: int | str
num_seeds: int
property is_completed: bool

Check if the phase group has completed.

property is_active: bool

Check if the phase group is currently active.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class lptk.SetSlot

Bases: BaseModel

A participant slot in a match/set.

entrant_id

Internal start.gg entrant ID.

entrant_name

Display name of the entrant.

score

Game score for this entrant in the set.

entrant_id: int | None
entrant_name: str | None
score: int | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class lptk.SetDetails

Bases: BaseModel

Details of a completed match/set.

set_id

Internal start.gg set ID.

identifier

Match identifier within the bracket (e.g., “AL”, “B1 AM”).

winner_id

Entrant ID of the winner.

winner_name

Display name of the winner.

loser_name

Display name of the loser.

winner_score

Winner’s game score.

loser_score

Loser’s game score.

set_id: int
identifier: str
winner_id: int | None
winner_name: str
loser_name: str
winner_score: int | None
loser_score: int | None
property bracket_group: str | None

Extract bracket group from identifier (e.g., ‘B1’ from ‘B1 AL’).

property match_id: str

Extract match ID from identifier (e.g., ‘AL’ from ‘B1 AL’).

format_score()

Format score for display, handling forfeits.

Return type:

str

Returns:

Formatted score string (e.g., “3-2”, “W-FF”, “FF-W”).

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].