Skip to content

Sprites

sprites

Sprites module.

Sprite

A dataclass representing a sprite.

url: str

content: bytes | Any

save(path: str | Path) -> None

Save the sprite at the specified path.

Parameters:

Name Type Description Default
path str | Path

the path where the sprint will be saved.

required
Source code in pypokeclient/_api/sprites.py
17
18
19
20
21
22
23
24
25
@validate_call
def save(self, path: str | Path) -> None:
    """Save the sprite at the specified path.

    Args:
        path (str | Path): the path where the sprint will be saved.
    """
    with open(path, "wb") as img:
        img.write(self.content)