Models¶
Pydantic models for typed access to API response records. Use Model.model_validate(record)
on dicts from ApiResponse.
All fields are optional (type | None = None) for forward compatibility. Unknown API fields
are preserved via extra="allow".
Type aliases¶
These handle LPDB API quirks automatically:
NullableDate — converts null sentinels (
"0000-01-01","") toNoneNullableDatetime — same for datetime fields (
"0000-01-01 00:00:00")LpdbDict — converts empty API lists (
[]) toNonefor dict-like fields
Base classes¶
Most models inherit from _LpdbModel, which provides common fields shared across standard
endpoints. Team template models use _TeamTemplateBase instead (different field set).
- class liquipydia._models._LpdbModel¶
Bases:
BaseModelBase model for LPDB v3 response records.
Provides common fields shared across most endpoints and allows extra fields since the API schema is not fully documented.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod __new__(*args, **kwargs)¶
- class liquipydia._models._TeamTemplateBase¶
Bases:
BaseModelBase model for team template records.
Team template endpoints return a different field set from standard endpoints (no
pageid,namespace,objectname, orwiki).- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod __new__(*args, **kwargs)¶
Standard models¶
- class liquipydia.Broadcaster¶
Bases:
_LpdbModelA broadcaster record from the
/broadcastersendpoint.- date: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Company¶
Bases:
_LpdbModelA company record from the
/companyendpoint.- locations: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- foundeddate: Annotated[datetime | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- defunctdate: Annotated[datetime | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- links: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Datapoint¶
Bases:
_LpdbModelA datapoint record from the
/datapointendpoint.- date: Annotated[datetime | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.ExternalMediaLink¶
Bases:
_LpdbModelAn external media link record from the
/externalmedialinkendpoint.- date: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- authors: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Match¶
Bases:
_LpdbModelA match record from the
/matchendpoint.- date: Annotated[datetime | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- links: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- match2bracketdata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Placement¶
Bases:
_LpdbModelA placement record from the
/placementendpoint.- startdate: Annotated[datetime | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- date: Annotated[datetime | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- lastvsdata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- opponentplayers: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Player¶
Bases:
_LpdbModelA player record from the
/playerendpoint.- birthdate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- deathdate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- links: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Series¶
Bases:
_LpdbModelA series record from the
/seriesendpoint.- organizers: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- locations: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- launcheddate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- defunctdate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- links: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.SquadPlayer¶
Bases:
_LpdbModelA squad player record from the
/squadplayerendpoint.- joindate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- leavedate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- inactivedate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.StandingsEntry¶
Bases:
_LpdbModelA standings entry record from the
/standingsentryendpoint.- opponentplayers: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- scoreboard: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.StandingsTable¶
Bases:
_LpdbModelA standings table record from the
/standingstableendpoint.- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Team¶
Bases:
_LpdbModelA team record from the
/teamendpoint.- locations: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- createdate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- disbanddate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- earningsbyyear: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- links: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Tournament¶
Bases:
_LpdbModelA tournament record from the
/tournamentendpoint.- serieslist: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- startdate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- enddate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- sortdate: Annotated[date | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- locations: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- extradata: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- class liquipydia.Transfer¶
Bases:
_LpdbModelA transfer record from the
/transferendpoint.- reference: Annotated[dict[str, Any] | None, BeforeValidator(func=_coerce_empty_list_to_none, json_schema_input_type=PydanticUndefined)]¶
- date: Annotated[datetime | None, BeforeValidator(func=_coerce_null_date, json_schema_input_type=PydanticUndefined)]¶
- classmethod __new__(*args, **kwargs)¶
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Team template models¶
- class liquipydia.TeamTemplate¶
Bases:
_TeamTemplateBaseA team template record from the
/teamtemplateendpoint.- classmethod __new__(*args, **kwargs)¶
- class liquipydia.TeamTemplateList¶
Bases:
_TeamTemplateBaseA team template list record from the
/teamtemplatelistendpoint.- classmethod __new__(*args, **kwargs)¶