Skip to main content

PokeLance

logo

license black mypy ruff stars downloads commits py versions

A flexible, statically typed and easy to use pokeapi wrapper for python 🚀


Features:

  • Modern and pythonic API asynchronously built on top of aiohttp
  • Flexible and easy to use
  • Fully typed with mypy
  • Linted with ruff
  • Well documented
  • Optimized for speed and performance
  • Automatically caches data for faster access
  • Caches endpoints for user convenience

Installation

$ python -m pip install PokeLance

Usage

import asyncio

from pokelance import PokeLance

client = PokeLance()  # Create a client instance


async def main() -> None:
    print(await client.ping())  # Ping the pokeapi
    print(await client.berry.fetch_berry("cheri"))  # Fetch a berry from the pokeapi
    print(await client.berry.fetch_berry_flavor("spicy"))
    print(await client.berry.fetch_berry_firmness("very-soft"))
    print(client.berry.get_berry("cheri"))  # Get a cached berry it will return None if it doesn't exist
    print(client.berry.get_berry_flavor("spicy"))
    print(client.berry.get_berry_firmness("very-soft"))
    await client.close()  # Close the client
    return None


asyncio.run(main())

With Async Context Manager

import asyncio

import aiohttp
from pokelance import PokeLance


async def main() -> None:
    # Use an async context manager to create a client instance
    async with aiohttp.ClientSession() as session, PokeLance(session=session) as client:
        print(await client.ping())  # Ping the pokeapi
        print(await client.berry.fetch_berry("cheri"))  # Fetch a berry from the pokeapi
        print(await client.berry.fetch_berry_flavor("spicy"))
        print(await client.berry.fetch_berry_firmness("very-soft"))
        print(client.berry.get_berry("cheri"))  # Get a cached berry it will return None if it doesn't exist
        print(client.berry.get_berry_flavor("spicy"))
        print(client.berry.get_berry_firmness("very-soft"))
        # The client will be closed automatically when the async context manager exits
    return None

asyncio.run(main())

Examples

Examples

Following examples are available open an issue if you want more examples or more details on certain examples.

  • Basic Usage
  • Advanced cache usage
  • Discord bot example
  • FastAPI example

Important Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pokelance-0.2.13.tar.gz (56.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pokelance-0.2.13-py3-none-any.whl (81.9 kB view details)

Uploaded Python 3

File details

Details for the file pokelance-0.2.13.tar.gz.

File metadata

  • Download URL: pokelance-0.2.13.tar.gz
  • Upload date:
  • Size: 56.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pokelance-0.2.13.tar.gz
Algorithm Hash digest
SHA256 ee71cd727f327c7f87deb6193d35d3fec6a67550bd9ea9c52c8ab4fcbdc30637
MD5 d2fc051f3d5af83209235293f3b63417
BLAKE2b-256 4f1aee35c3875617731654bdbd753ef0f6f24dfca3a86a4f9abb5a0129fca043

See more details on using hashes here.

File details

Details for the file pokelance-0.2.13-py3-none-any.whl.

File metadata

  • Download URL: pokelance-0.2.13-py3-none-any.whl
  • Upload date:
  • Size: 81.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pokelance-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 0ec343ec307ad5403f3576a4e211781fdf1b45b382dab6f4afe0026305fa75c9
MD5 94ebffe83b01e23999961b4cc38254b5
BLAKE2b-256 79773e94005daeaaf749b5f494c1d9e7ab69778c518e10f434d222341a68d804

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.17

2 files

0.2.16

2 files

0.2.15

2 files

0.2.14

2 files

This release

0.2.13 This release

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.1

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page