Skip to content

Game

pokelance.models.abstract.game ⚓︎

Generation ⚓︎

Bases: BaseModel

Generation model.

Attributes:

Name Type Description
id int

The identifier for this resource.

name str

The name for this resource.

abilities List[NamedResource]

A list of abilities that were introduced in this generation.

names List[Name]

The name of this resource listed in different languages.

main_region NamedResource

The main region travelled in this generation.

moves List[NamedResource]

A list of moves that were introduced in this generation.

pokemon_species List[NamedResource]

A list of Pokémon species that were introduced in this generation.

types List[NamedResource]

A list of types that were introduced in this generation.

version_groups List[NamedResource]

A list of version groups that were introduced in this generation.

to_dict() ⚓︎

Convert the model to a dict

Returns:

Type Description
Dict[str, Any]

The model as a dict.

Source code in pokelance/models/_base.py
Python
def to_dict(self) -> t.Dict[str, t.Any]:
    """Convert the model to a dict

    Returns
    -------
    typing.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(self)

Pokedex ⚓︎

Bases: BaseModel

Pokedex model.

Attributes:

Name Type Description
id int

The identifier for this resource.

name str

The name for this resource.

is_main_series bool

Whether or not this Pokédex originated in the main series of the video games.

descriptions List[Description]

The description of this resource listed in different languages.

names List[Name]

The name of this resource listed in different languages.

pokemon_entries List[PokemonEntry]

A list of Pokémon catalogued in this Pokédex and their indexes.

region NamedResource

The region this Pokédex catalogues Pokémon for.

version_groups List[NamedResource]

A list of version groups this Pokédex is relevant to.

to_dict() ⚓︎

Convert the model to a dict

Returns:

Type Description
Dict[str, Any]

The model as a dict.

Source code in pokelance/models/_base.py
Python
def to_dict(self) -> t.Dict[str, t.Any]:
    """Convert the model to a dict

    Returns
    -------
    typing.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(self)

Version ⚓︎

Bases: BaseModel

Version model.

Attributes:

Name Type Description
id int

The identifier for this resource.

name str

The name for this resource.

names List[Name]

The name of this resource listed in different languages.

version_group NamedResource

The version group this version belongs to.

to_dict() ⚓︎

Convert the model to a dict

Returns:

Type Description
Dict[str, Any]

The model as a dict.

Source code in pokelance/models/_base.py
Python
def to_dict(self) -> t.Dict[str, t.Any]:
    """Convert the model to a dict

    Returns
    -------
    typing.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(self)

VersionGroup ⚓︎

Bases: BaseModel

VersionGroup model.

Attributes:

Name Type Description
id int

The identifier for this resource.

name str

The name for this resource.

order int

Order for sorting. Almost by date of release, except similar versions are grouped together.

generation NamedResource

The generation this version was introduced in.

move_learn_methods List[NamedResource]

A list of methods in which Pokémon can learn moves in this version group.

pokedexes List[NamedResource]

A list of Pokédexes introduces in this version group.

regions List[NamedResource]

A list of regions that can be visited in this version group.

versions List[NamedResource]

A list of versions this version group owns.

to_dict() ⚓︎

Convert the model to a dict

Returns:

Type Description
Dict[str, Any]

The model as a dict.

Source code in pokelance/models/_base.py
Python
def to_dict(self) -> t.Dict[str, t.Any]:
    """Convert the model to a dict

    Returns
    -------
    typing.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(self)