Skip to content

UniteDb

py_unite_db.UniteDb

Bases: UniteDbBase

Wrapper for the Unite DB rest API.

Example

from py_unite_db import UniteDb unite_db = UniteDb() unite_db.pokemon[0].name 'Absol' unite_db.held_items[0].name 'Aeos Cookie'

Source code in py_unite_db/__init__.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class UniteDb(UniteDbBase):
    """Wrapper for the Unite DB rest API.

    Example:
        >>> from py_unite_db import UniteDb
        >>> unite_db = UniteDb()
        >>> unite_db.pokemon[0].name
        'Absol'
        >>> unite_db.held_items[0].name
        'Aeos Cookie'
    """

    def __init__(self):
        super().__init__(BASE_URL, requests.Session())

pokemon: list[Pokemon] cached property

Get all pokemon.

Returns list of Pokemon.

battle_items() -> list[BattleItem]

Get all battle items.

Returns list of BattleItem.

Source code in py_unite_db/unite_db.py
39
40
41
42
43
44
@endpoint
def battle_items(self) -> list[BattleItem]:  # type: ignore[empty-body]
    """Get all battle items.

    Returns list of [`BattleItem`][py_unite_db.models.BattleItem].
    """

held_items() -> list[HeldItem]

Get all held items.

Returns list of HeldItem.

Source code in py_unite_db/unite_db.py
32
33
34
35
36
37
@endpoint
def held_items(self) -> list[HeldItem]:  # type: ignore[empty-body]
    """Get all held items.

    Returns list of [`HeldItem`][py_unite_db.models.HeldItem].
    """