API

Structure

The following API documentation does not include all modules of autodoc_pydantic. Instead, it focuses only on modules that are relevant for documentation purposes:

judobase
|
|- __init__.py
|- base.py
|- judobase.py
|- schemas.py

For everything else, please refer to the source code directly.

Modules

base.py

This module is located at judobase/base.py.

Base classes for API interaction with session management.

class judobase.base.CompetitionAPI(timeout: float = 10)

Bases: _Base

Handles competition-related API requests.

async get_competition_list(years: str = '', months: str = '') → list[Competition]

Fetches list of competitions.

async get_competition_info(competition_id: int | str) → Competition

Fetches details of a specific competition.

class judobase.base.ContestAPI(timeout: float = 10)

Bases: _Base

Handles contest-related API requests.

async find_contests(competition_id: int | str = '', weight_id: int | str = '', person_id: int | str = '', include: str = 'info', contest_code: str = '') → list[Contest]

Fetches list of contests.

include can contain a comma-separated list of: info, events.

class judobase.base.JudokaAPI(timeout: float = 10)

Bases: _Base

Handles judoka-related API requests.

async get_judoka_info(competitor_id: int | str) → Judoka

Fetches judoka information.

class judobase.base.RatingAPI(timeout: float = 10)

Bases: _Base

Handles rating-related API requests.

async get_rating_history(competitor_id: int | str) → list[RatingHistory]

Fetches rating history.

async get_current_rating(competitor_id: int | str) → list[CurrentRating]

Fetches current rating rows for a competitor.

async get_ranking_list(age_id: int | str | None = None, weight_id: int | str | None = None) → list[RankingEntry]

Fetches the current World Ranking List, optionally of one age group or weight.

class judobase.base.CountryAPI(timeout: float = 10)

Bases: _Base

Handles country-related API requests.

async get_country_info(country_id: int | str) → Country

Fetches country information.

async get_country_list() → list[CountryShort]

Fetches all countries short information.

judobase_api.py

This module is located at judobase/judobase_api.py.

class judobase.judobase_api.JudoBase(timeout: float = 10)

Bases: CompetitionAPI, ContestAPI, JudokaAPI, CountryAPI, RatingAPI

Class for extended interacting with the JudoBase API.

Provides methods to retrieve information about competitions, contests, judokas, and countries.

async all_competition() → list[Competition]

Retrieves data for all competitions.

async competitions_in_range(start_date: date, end_date: date) → list[Competition]

Retrieves data for competitions starting within a specified date range.

Both days are included. A datetime is accepted too, only its day is used.

async competition_by_id(competition_id: int | str) → Competition

Retrieves data for a specific competition by its ID.

async all_contests() → list[Contest]

Retrieves data for all contests using concurrent API calls.

async contests_by_competition_id(competition_id: int | str, weight: WeightEnum | None = None, *, include_events: bool = False) → list[Contest]

Retrieves data for all contests using concurrent API calls.

Optionally filters by weight category and includes data about contests events like throw, osaekomi or shido.

async judoka_by_id(judoka_id: int | str) → Judoka

Retrieves data for a specific judoka by their ID.

async country_by_id(country_id: int | str) → Country

Retrieves data for a specific country by its ID.

async all_countries() → list[CountryShort]

Retrieves short data for all the countries.

async current_rating_by_id(judoka_id: int | str) → list[CurrentRating]

Retrieves current WRL rows for a specific judoka.

async rating_history_by_id(judoka_id: int | str) → list[RatingHistory]

Retrieves WRL history rows for a specific judoka.

async world_ranking_list(weight: WeightEnum | None = None) → list[RankingEntry]

Retrieves the current senior World Ranking List, of every weight or of one.