Skip to content

Models

pokelance.models.common.models ⚓︎

Description ⚓︎

Bases: BaseModel

Model for a description object

Attributes:

Name Type Description
description str

The localized description for an API resource in a specific language.

language NamedResource

The language this name is in.

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)

Effect ⚓︎

Bases: BaseModel

Model for an effect object

Attributes:

Name Type Description
effect str

The localized effect text for an API resource in a specific language.

language NamedResource

The language this effect is in.

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)

Encounter ⚓︎

Bases: BaseModel

Model for an encounter object

Attributes:

Name Type Description
min_level int

The lowest level the Pokémon could be encountered at.

max_level int

The highest level the Pokémon could be encountered at.

condition_values List[NamedResource]

A list of condition values that must be in effect for this encounter to occur.

chance int

The chance of the encounter to occur on a version of the game.

method NamedResource

The method by which this encounter happens.

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)

FlavorText ⚓︎

Bases: BaseModel

Model for a flavor text object

Attributes:

Name Type Description
flavor_text str

The localized flavor text for an API resource in a specific language.

language NamedResource

The language this name is in.

version NamedResource

The version this flavor text entry 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)

GenerationGameIndex ⚓︎

Bases: BaseModel

Model for a generation game index object

Attributes:

Name Type Description
game_index int

The internal id of an API resource within game data.

generation NamedResource

The generation relevent to this game index.

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)

Language ⚓︎

Bases: BaseModel

Model for a language object

Attributes:

Name Type Description
id int

The identifier for this resource.

name str

The name for this resource.

official bool

Whether or not the games are published in this language.

iso639 str

The two-letter code of the country where this language is spoken. Note that it is not unique.

iso3166 str

The two-letter code of the language. Note that it is not unique.

names List[Name]

The name of this resource listed in different languages.

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)

MachineVersionDetail ⚓︎

Bases: BaseModel

Model for a machine version detail object

Attributes:

Name Type Description
machine Resource

The machine that teaches a move from an item.

version_group NamedResource

The version group of this specific machine.

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)

Name ⚓︎

Bases: BaseModel

Model for a name object

Attributes:

Name Type Description
name str

The localized name for an API resource in a specific language.

language NamedResource

The language this name is in.

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)

VerboseEffect ⚓︎

Bases: BaseModel

Model for a verbose effect object

Attributes:

Name Type Description
effect str

The localized effect text for an API resource in a specific language.

short_effect str

The localized short effect text for an API resource in a specific language.

language NamedResource

The language this effect is in.

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)

VersionEncounterDetail ⚓︎

Bases: BaseModel

Model for a version encounter detail object

Attributes:

Name Type Description
max_chance int

The chance of an encounter to occur.

encounter_details List[Encounter]

A list of encounters and their specifics.

version NamedResource

The game version this encounter happens in.

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)

VersionGameIndex ⚓︎

Bases: BaseModel

Model for a version game index object

Attributes:

Name Type Description
game_index int

The internal id of an API resource within game data.

version NamedResource

The version relevent to this game index.

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)

VersionGroupFlavorText ⚓︎

Bases: BaseModel

Model for a version group flavor text object

Attributes:

Name Type Description
text str

The localized name for an API resource in a specific language.

language NamedResource

The language this name is in.

version_group NamedResource

The version group which uses this flavor text.

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)