Skip to content

Location

pokelance.models.abstract.location ⚓︎

Location ⚓︎

Bases: BaseModel

Location model.

Attributes:

Name Type Description
id int

The identifier for this resource.

name str

The name for this resource.

region NamedResource

The region this location can be found in.

names List[Name]

The name of this resource listed in different languages.

game_indices List[GenerationGameIndex]

A list of game indices relevent to this location by generation.

areas List[NamedResource]

A list of methods in which Pokémon may be encountered in this location.

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)

LocationArea ⚓︎

Bases: BaseModel

LocationArea model.

Attributes:

Name Type Description
id int

The identifier for this resource.

name str

The name for this resource.

game_index int

The internal id of an API resource within game data.

encounter_method_rates List[EncounterMethodRate]

A list of methods in which Pokémon may be encountered in this area and how likely the method will occur depending on the version of the game.

location NamedResource

The region this location can be found in.

names List[Name]

The name of this resource listed in different languages.

pokemon_encounters List[PokemonEncounter]

A list of Pokémon that can be encountered in this area along with version specific details about the encounter.

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)

PalParkArea ⚓︎

Bases: BaseModel

PalParkArea 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.

pokemon_encounters List[PalParkEncounterSpecies]

A list of Pokémon encountered in this pal park area along with details.

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)

Region ⚓︎

Bases: BaseModel

Region model.

Attributes:

Name Type Description
id int

The identifier for this resource.

name str

The name for this resource.

locations List[NamedResource]

A list of locations that can be found in this region.

main_generation NamedResource

The generation this region was introduced in.

names List[Name]

The name of this resource listed in different languages.

pokedexes List[NamedResource]

A list of pokédexes that catalogue Pokémon in this region.

version_groups List[NamedResource]

A list of version groups where this region can be visited.

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)