Resources¶
Resource classes wrap individual LPDB v3 endpoints. Each resource is reachable as an attribute on
LiquipediaClient. The resource layer adds three things on top of the raw
HTTP API:
Keyword filters — kwargs like
nationality="Denmark"are turned into[[nationality::Denmark]]and AND-joined with any explicitconditionsstring.Filter-key validation — keys that don’t match the resource’s Pydantic model raise
ValueErrorbefore a request goes out.Pagination —
paginate()yields individual records, transparently fetching successive pages.
Base class¶
All standard endpoints share the same surface, defined on Resource:
- class liquipydia.Resource¶
Bases:
objectBase resource wrapping a single LPDB v3 endpoint.
Provides
listandpaginatemethods that delegate HTTP calls to the parent client. Subclasses set_endpointto the API path segment (e.g."player") and_modelto the corresponding Pydantic model class for filter key validation.- Parameters:
client (
LiquipediaClient) – The parent LiquipediaClient instance.
- __init__(client)¶
- list(wiki, *, conditions=None, query=None, limit=50, offset=0, order=None, groupby=None, rawstreams=False, streamurls=False, **filters)¶
Query this endpoint and return results.
- Parameters:
wiki (
str) – Wiki(s) to query (pipe-separate for multi-wiki, e.g."dota2|counterstrike").conditions (
str|None(default:None)) – Filter expression using LPDB condition syntax.query (
str|None(default:None)) – Comma-separated list of fields to return.limit (
int(default:50)) – Maximum number of results (1–1000).offset (
int(default:0)) – Number of results to skip.order (
str|None(default:None)) – SQL-style ordering (e.g."id ASC").groupby (
str|None(default:None)) – SQL-style grouping (e.g."id ASC").rawstreams (
bool(default:False)) – Return raw stream data (/matchendpoint only).streamurls (
bool(default:False)) – Return stream URLs (/matchendpoint only).**filters (
str) – Keyword filters converted to conditions (e.g.name="Zen"becomes[[name::Zen]]). Prefix values with>,<, or!for operators.
- Return type:
- Returns:
Parsed API response.
- paginate(wiki, *, conditions=None, query=None, order=None, groupby=None, rawstreams=False, streamurls=False, page_size=50, max_results=None, **filters)¶
Iterate through paginated results from this endpoint.
Yields individual record dicts, automatically requesting successive pages.
- Parameters:
wiki (
str) – Wiki(s) to query.conditions (
str|None(default:None)) – Filter expression using LPDB condition syntax.query (
str|None(default:None)) – Comma-separated list of fields to return.rawstreams (
bool(default:False)) – Return raw stream data (/matchendpoint only).streamurls (
bool(default:False)) – Return stream URLs (/matchendpoint only).page_size (
int(default:50)) – Number of records per page (max 1000).max_results (
int|None(default:None)) – Stop after yielding this many records.Nonefor unlimited.**filters (
str) – Keyword filters converted to conditions (e.g.name="Zen"becomes[[name::Zen]]). Prefix values with>,<, or!for operators.
- Yields:
Individual record dicts from the API.
Standard resources¶
These 13 resources inherit list() and paginate() from Resource
unchanged. They differ only in their endpoint path and the model used for filter-key validation:
Class |
Endpoint |
Model |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Specialized resources¶
Three resources need their own entry, either because of an extra parameter or a different method signature.
MatchResource¶
Inherits list() and paginate() from Resource. The rawstreams and
streamurls keyword arguments accepted by the base class are only meaningful on this endpoint;
on any other resource the API ignores them.
TeamTemplateResource¶
Single-template lookup. Uses get(wiki, template, date=...) — conditions, limit,
offset, order and multi-wiki are not supported. The optional date parameter returns
the template state at that historical date (useful for rendering era-correct logos on archived
tournament pages).
- class liquipydia.TeamTemplateResource¶
Bases:
objectResource for the
/teamtemplateendpoint (single template lookup).This endpoint has a different parameter signature from standard resources and does not support
conditions,limit,offset, ororder.- Parameters:
client (
LiquipediaClient) – The parent LiquipediaClient instance.
- __init__(client)¶
- get(wiki, template, *, date=None)¶
Get a single team template.
- Parameters:
- Return type:
- Returns:
Parsed API response.
TeamTemplateListResource¶
Bulk template listing. Uses list(wiki, pagination=N) — page-based navigation, no
limit/offset and no multi-wiki. Some result rows can be None and must be filtered
before validation:
response = client.team_template_list.list("rocketleague")
for record in response.result:
if record is None:
continue
template = TeamTemplateList.model_validate(record)
- class liquipydia.TeamTemplateListResource¶
Bases:
objectResource for the
/teamtemplatelistendpoint.This endpoint has a different parameter signature from standard resources and does not support
conditions,limit,offset, ororder.- Parameters:
client (
LiquipediaClient) – The parent LiquipediaClient instance.
- __init__(client)¶
- list(wiki, *, pagination=None)¶
Get a list of team templates.
- Parameters:
- Return type:
- Returns:
Parsed API response.