Skip to main content

A Python wrapper for the friendly PokeAPI database

Project description

Pokebase swampert

actions Python 3.6 pypi Python >=3.8 github

pokebase is a simple but powerful Python interface to the PokéAPI database

Maintainer: GregHilmes


Version Support

pokebase 1.3.0 supports Python 3.6. Install it with pip install pokebase

pokebase 1.4.0 drops support for Python 3.6 and adds support for Python >=3.8 <=3.12. Install it with pip install


>>> import pokebase as pb
>>> chesto = pb.APIResource('berry', 'chesto')
>>> charmander = pb.pokemon('charmander') # Quick lookup.
>>> charmander.height
>>> # Now with sprites! (again!)
>>> s1 = pb.SpriteResource('pokemon', 17)
<pokebase.interface.SpriteResource object at 0x7f2f15660860>
>>> s1.url
>>> s2 = pb.SpriteResource('pokemon', 1, other=True, official_artwork=True)
>>> s2.path
>>> s3 = pb.SpriteResource('pokemon', 3, female=True, back=True)
>>> s3.img_data b'x89PNGrnx1anx00x00x00rIHDRx00x00x00 ... xca^x7fxbbd\*x00x00x00x00IENDxaeB`x82'

... And it's just that simple.


  • an endpoint is the results of an API call like or
  • a resource is the actual data, from a call to


Python unit tests are in a separate tests directory and can be run via python -m tests.

Notes to the developer using this module

The quick data lookup for a Pokémon type, is pokebase.type_('type-name'), not pokebase.type('type-name'). This is because of a naming conflict with the built-in type function, were you to from pokebase import *.

When changing the cache, avoid importing the cache constants directly. You should only import them with the whole cache module. If you do not do this, calling set_cache will not change your local copy of the variable.


>>> from pokebase.cache import API_CACHE

Do this :)

>>> from pokebase import cache
>>> cache.API_CACHE

Project details

Download files

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

Source Distribution

pokebase-1.4.1.tar.gz (15.5 kB view hashes)

Uploaded source

Built Distribution

pokebase-1.4.1-py3-none-any.whl (11.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page