Kalista Models

Game

class kalista.models.game.Game(*, id: int, match_id: int | None = None, game_number: int | None = None, tournament: int | None = None, blue_team: Team | None = None, red_team: Team | None = None, winner: Team | None = None, date: datetime | None = None, region: int | None = None, league: str | None = None, vod: str | None = None, patch: str | None = None, participants: DataFrame | None = None)[source]

Game model

blue_team: Team | None

An instance of Team representing the team on the blue side.

date: datetime | None

The date and time of the game.

async fetch()[source]

Fetch all the frame data

async game_data()[source]

Gets game data for a given gameID

game_number: int | None

The game number in a best of series.

id: int

A unique integer identifier for the game.

league: str | None

The unique slug of the league.

match_id: int | None

A unique integer identifier for the match.

participants: DataFrame | None

A DataFrame containing information about the participants in the game.

patch: str | None

The patch version of the game.

property player_frames: DataFrame

Returns the player frames

Returns:

Player frames, gives information for each frame of a game

Return type:

DataFrame

Raises:

AttributeError – If frames have not been fetched yet. call await fetch() first.

red_team: Team | None

An instance of Team representing the team on the red side.

region: int | None

A unique integer identifier for the league.

property team_frames: DataFrame

Returns the team frames

Returns:

Team frames, gives information for each frame of a game

Return type:

DataFrame

Raises:

AttributeError – If frames have not been fetched yet. call await fetch() first.

tournament: int | None

A unique integer identifier for the tournament.

vod: str | None
winner: Team | None

An instance of Team representing the winning team.

class kalista.models.game.VOD[source]

VOD model

language_english: str = None
language_original: str = None
locale: str = None
parameter: str = None
provider: str = None
property url: str

Returns the url for the VOD

kalista.models.game.round_time(dt: datetime = datetime.datetime(2024, 6, 24, 1, 21, 30, 75055), date_delta: timedelta = datetime.timedelta(seconds=10), round_up: bool = False)[source]

Round a datetime object to a multiple of a timedelta

Parameters:
  • dt (datetime) – datetime.datetime object, default now.

  • date_delta (timedelta) – timedelta object, we round to a multiple of this, default 1 minute.

  • round_up (bool) – Round up, down or to nearest

League

class kalista.models.league.League(*, id: int | None = None, slug: str = None, name: str = None, image: str = None, region: str = None)[source]

League Model

async fetch() None[source]

Fetch the league data

async classmethod get_all_leagues() list[League][source]

Get all the leagues :returns: The list of all League of Legends leagues :rtype: list[League]

image: str

The image URL of the league logo.

league_id: int | None

The unique ID of the league

name: str

The name of the league.

region: str

The region of the league.

slug: str

The slug of the league. A slug is a unique string identifier for a league.

property tournaments: List[Tournament]

Get the tournaments for this league

Returns:

The list of tournaments for this league

Return type:

List[Tournament]

Raises:

AttributeError – If the tournaments have not been fetched yet

Match

class kalista.models.match.Match(*, id: int, tournament_id: int | None = None, league_slug: str | None = None, team1: Team | None = None, team1_code: str | None = None, team2: Team | None = None, team2_code: str | None = None, winner: str | None = None, start_time: datetime | None = None, region: str | None = None, league_id: int | None = None, is_live: bool | None = None, best_of: int | None = None)[source]

Match model

best_of: int | None

The number of games in the match.

async fetch(client: ClientSession | None = None) None[source]

Fetch all the match data

property games: list[Game]

Get the games for this match

Returns:

The list of games in the match. List of Game objects.

Return type:

list[Game]

Raises:

AttributeError – If the games have not been fetched yet. Call await fetch() first.

id: int

The unique ID of the match.

is_live: bool | None

Whether the match is live or not.

league_id: int | None

The unique ID of the league.

league_slug: str | None

The slug of the league. A slug is a unique string identifier for a league.

region: str | None

The region of the match.

start_time: datetime | None

The date of the match.

team1: Team | None

Team in the match.

Type:

The first

Type:

class

team1_code: str | None

Team in the match.

Type:

The code of the first

Type:

class

team2: Team | None

Team in the match.

Type:

The second

Type:

class

team2_code: str | None

Team in the match.

Type:

The code of the second

Type:

class

tournament_id: int | None

The unique ID of the tournament.

winner: str | None

The winner of the match.

Player

class kalista.models.player.Player(*, id: int | None = None, first_name: str | None = None, last_name: str | None = None, summoner_name: str | None = '', image: str | None = None, role: str | None = None, status: str | None = None, team: str | None = None, team_id: int | None = None, team_name: str | None = None, region: str | None = None, league: str | None = None, tournaments: list[int] | None = [], games: list[int] | None = [])[source]

Player Model

first_name: str | None

The first name of the player.

games: list[int] | None
classmethod get_all_players() list[Player][source]

Get all players

Returns:

The list of all players

Return type:

list[Player]

id: int | None

The unique ID of the player.

image: str | None

The image URL of the player.

last_name: str | None

The last name of the player.

league: str | None

The league of the player.

region: str | None

The region of the player.

role: str | None

The role of the player.

status: str | None

The status of the player.

summoner_name: str | None

The summoner name of the player.

team: str | None

The team of the player.

team_id: int | None

The team id.

team_name: str | None

The team name.

tournaments: list[int] | None

Schedule

class kalista.models.schedule.Schedule(*, league_id: int | None = None, matches: list[Match] | None = [])[source]

Schedule model

async fetch()[source]

Fetch all the schedule data

league_id: int | None

The unique ID of the league.

matches: list[Match] | None

The list of matches in the schedule. List of Match objects.

property start_date

Get the start date of the tournament

Standings

class kalista.models.standings.Standings(*, region: str | None = None, league_id: int | None = None, tournament_id: int | None = None, teams: list[Team] | None = [], week: int | None = None, standings: dict[int, str | list[str]] = {})[source]

Standings Model

async fetch()[source]

Fetch all the standings data

league_id: int | None

The unique ID of the league.

region: str | None

The region of the standings.

standings: dict[int, str | list[str]]

The standings.

teams: list[Team] | None

The list of teams in the standings. List of Team objects.

tournament_id: int | None

The unique ID of the tournament.

week: int | None

The week of the standings.

kalista.models.standings.convert_to_ordinal(n: int)[source]

Return the ordinal suffix of a number

Team

class kalista.models.team.Team(*, id: int | None = None, name: str | None = None, slug: str = None, code: str | None = None, image: str | None = None, region: str | None = None, league_name: str | None = None, roster: list[Player] | None = None, alternative_image: str | None = None, background_image: str | None = None)[source]

Team Model

alternative_image: str | None

The alternative image URL of the team logo.

background_image: str | None

The background image URL of the team logo.

code: str | None

The code of the team.

async fetch()[source]

Fetch all the team data

async classmethod get_all_teams() list[Team][source]

Get all the teams

Returns:

The list of all teams

Return type:

list[Team]

id: int | None

The unique ID of the team.

image: str | None

The image URL of the team logo.

league_name: str | None

The league name of the team.

name: str | None

The name of the team.

region: str | None

The region of the team.

roster: list[Player] | None

The list of players in the team. List of Player objects.

slug: str

The slug of the team. A slug is a unique string identifier for a team.

Tournament

class kalista.models.tournament.Tournament(*, id: int | None = None, slug: str | None = '', start_date: datetime | None = None, end_date: datetime | None = None, league_id: int | None = None, league_slug: str | None = None, teams: list[Team] | None = None, region: str | None = '', games: list[Game] | None = [])[source]

Tournament Model

end_date: datetime | None

The end date of the tournament.

async fetch()[source]

Fetch all the tournament data

games: list[Game] | None

The list of games in the tournament. List of Game objects.

async classmethod get_tournaments_for_league(league_id: str) list[Tournament][source]

Get a tournament by its slug

id: int | None

The unique ID of the tournament.

property is_active: bool

Check if the tournament is active

Returns:

True if the tournament is active, False otherwise

Return type:

bool

league_id: int | None

The unique ID of the league.

league_slug: str | None

The league slug of the tournament.

property name: str

Get the name of the tournament

Returns:

The name of the tournament

Return type:

str

region: str | None

The region of the tournament.

slug: str | None

The slug of the tournament. A slug is a unique string identifier for a tournament.

start_date: datetime | None

The start date of the tournament.

teams: list[Team] | None

The list of teams in the tournament. List of Team objects.