trackmania.trophy module

class trackmania.trophy.PlayerTrophies(echelon: int, last_change: datetime, points: int, trophies: list[int], player_id: Optional[str] = None)[source]

Bases: TrophyObject

New in version 0.1.0.

Represents Player Trophies

Parameters
  • echelon (int) – The trophy echelon of the player.

  • last_change (str) – The date of the last change of the player’s self.

  • points (ints: int) – The number of points of the player.

  • trophies (list[int]) – The number of trophies of the player.

  • player_id (str | NoneType, optional) – The Trackmania ID of the player

async history(page: int = 0) dict[source]

New in version 0.3.0.

Retrieves Trophy Gain and Loss history of a player.

Parameters

page (int, optional) – page number of trophy history, by default 0

Returns

Trophy history data.

Return type

dict

Raises
property last_change

Last change property.

property player_id

player_id property

score() int[source]

New in version 0.3.0.

Returns the total trophy score of the player.

Returns

The total score.

Return type

int

set_id(player_id: str)[source]

Setter for player_id

async static top_trophies(page: int = 0) list[trackmania.trophy.TrophyLeaderboardPlayer][source]

New in version 0.3.0.

Get’s the top players ranked by trophies

Parameters

page (int, optional) – The page of the leaderboards, by default 0

Returns

The players as a list of TrophyLeaderboardPlayer objects.

Return type

list[TrophyLeaderboardPlayer]

trophy(number: int) int[source]

New in version 0.3.0.

Returns the trophies by tier.

Parameters

number (int) – The trophy number, from 1 (T1) to 9 (T9).

Returns

the number of trophies for that specific tier.

Return type

int

class trackmania.trophy.TrophyLeaderboardPlayer(player_name: str, club_tag: str | None, player_id: str, rank: int, score: str, zones: list)[source]

Bases: TrophyObject

New in version 0.4.0.

Represents a player on the trophy leaderboards

Parameters
  • player_name (str) – The player’s name

  • club_tag (str | None) – The player’s club tag

  • player_id (str) – The player’s ID

  • rank (int) – The player’s rank

  • score (str) – The player’s score

  • zones (list[PlayerZone]) – The player’s zones

async get_player()[source]

New in version 0.4.0.

Gets the player object using the player ID.

Returns

The player object

Return type

Player