onix.model module

Onix’s fundamental data types

class onix.model.PokeStats[source]

Bases: onix.model.PokeStats

Container to represent a Pokemon’s stats. This could be base stats, IVs/EVs or battle-stats.

Parameters:
  • hp (int) – hit point stat
  • atk (int) – attack stat
  • dfn (int) – defense stat (you can’t have a field named “def”)
  • spa (int) – special attack stat
  • spd (int) – special defense stat
  • spe (int) – speed stat
class onix.model.Forme[source]

Bases: onix.model.Forme

Container to represent a Pokemon’s Forme (that is, the aspects of a moveset that might change when forme changes).

Parameters:
  • species (str) – forme name
  • ability (str) – the Pokemon’s ability
  • stats (PokeStats) – the Pokemon’s battle stats (that is, not base stats)
class onix.model.Moveset[source]

Bases: onix.model.Moveset

Container comprising a complete description of a specific build’s battle-relevant attributes (read: not nickname).

Parameters:
  • formes (list of Forme) –

    the formes the Pokemon might take over the course of the battle

    Note

    The first forme in this list is considered the Pokemon’s “primary forme.” It is the forme the Pokemon will appear in the first time it appears on the field (making an exception for orb-holding Groudon and Kyogre who transform immediately into their Primal formes and do not change back)

  • gender ('m', 'f' or 'u') – the Pokemon’s gender (‘u’ represents “not specified”)
  • item (str) – the Pokemon’s held item
  • moves (list of str) – the moves the Pokemon knows
  • level (int) – the Pokemon’s level
  • happiness (int) – the Pokemon’s happiness

Note

Nature, IVs and EVs aren’t included in this description, since there might be multiple ways to get to the same battle-stats, but they’re all functionally equivalent.

class onix.model.Player[source]

Bases: onix.model.Player

Container for metadata about a given player/alt

Parameters:
  • id (str) – the player’s unique ID
  • rating (dict) – dictionary of player ratings (e.g. Elo, W-L record...). The specifics of what’s included in this dict will vary based on the context.
class onix.model.BattleInfo[source]

Bases: onix.model.BattleInfo

Container consisting of metadata for a given battle

Parameters:
  • id (int) – numerical id of the battle, typically found in the name of the log
  • format (str) – the metagame of the battle
  • date (datetime.date) – the date on which the battle occurred
  • players (list of Player) – the battle participants
  • slots (list of list of str) – the set IDs for the Pokemon on each player’s team. Should have the same length as players
  • turn_length (int) – the number of turns in the battle
  • end_type (str) – how the battle ended (e.g. “normal” or “forfeit”)