rankade.models.NewMatch

Module Contents

Classes

NewMatch

This class to be used for creating Matches to post to the Rankade API.

NewMatchList

Represents the list of NewMatches returned by the Rankade server. Individual NewMatch objects returned by the server can be accessed in the same way as a regular list.

API

class NewMatch[source]

Bases: rankade.models.Base.RankadeObject

This class to be used for creating Matches to post to the Rankade API.

notes: str = None

General notes.

name: str = <Multiline-String>

Match name.

Note

Use any custom string for the name of the match or 2 special options are available:

“default_1”

set game’s name as the match name.

“default_2”

to set faction/player name vs other faction/player name as the match name.

game: Optional[Game] = 'field(...)'

Game id retrieved from GET /games/search, GET /games, or GET /games/popular API calls.

factions: Optional[Factions] = 'field(...)'

Factions’ data.

weight: str = 'field(...)'

Match weight, chosen from this list: ultralight, light, midlight, normal, heavy, massive. A heavier game results in larger variations in ree score, a lighter game in smaller ones. We strongly suggest you to set weights in a way that most of the matches have normal weight. See FAQ for details.

add_bot_faction(rank: int, points: str, name: str = '')[source]

Convenience method to add a bot faction to the match.

add_faction(players: Union[Players, Player], rank: int, points: str, name: str = '', bot: bool = False)[source]

Convenience method to add a faction to the match.

as_dict() rankade.api.Api.JSON[source]

Returns a custom dictionary for new match server post request.

class NewMatchList(initlist=None)[source]

Bases: rankade.models.Base.ResultList[rankade.models.NewMatch.NewMatch]

Represents the list of NewMatches returned by the Rankade server. Individual NewMatch objects returned by the server can be accessed in the same way as a regular list.

Initialization

_content_class: ClassVar[Type[RankadeObject]] = None

ClassVar to allow the an object in the list to be created from a dict returned from the server.