Skip to main content

PyPokedex

A lightweight Python library for Pokémon lookups, random Pokémon, type data, and generation lists. It uses the public PokéAPI and has no third-party runtime dependencies.

UNRELATED WITH ARNAVB'S PYPOKEDEX

Install

From this folder:

python -m pip install .

Or install the built wheel from a package build. Python 3.9+ is supported.

Quick start

import pypokedex

# Look up a Pokémon by name or National Pokédex number
pikachu = pypokedex.get_pokemon("pikachu")
print(pikachu["name"], pikachu["id"])  # pikachu 25

# Find a Pokédex number
print(pypokedex.get_pokedex_number("charizard"))  # 6

# Get the name for a Pokédex number
print(pypokedex.get_pokemon_name(150))  # mewtwo

# Generate a random Pokémon
print(pypokedex.random_pokemon()["name"])

# Restrict random selection to a range
print(pypokedex.random_pokemon(1, 151)["name"])

# Search by part of a name
print([p["name"] for p in pypokedex.search_pokemon("saur")])

# Get types and abilities
print(pypokedex.get_pokemon_types("bulbasaur"))
print(pypokedex.get_pokemon_abilities("pikachu"))

# Get type information and a generation's species
fire = pypokedex.get_type("fire")
print(fire["damage_relations"]["double_damage_to"])
print(pypokedex.list_generation(1)[:10])

# Clear cached API responses
pypokedex.clear_cache()

Main functions

Function Description
get_pokemon(name_or_number) Full Pokémon data from PokéAPI
get_pokedex_number(name) National Pokédex number
get_pokemon_name(number) Canonical name for a number
random_pokemon(min_number=1, max_number=1025) Random Pokémon record
search_pokemon(query, limit=20) Search names by substring
get_pokemon_types(name_or_number) List of type names
get_pokemon_abilities(name_or_number) List of ability names
get_type(type_name) Type details and damage relations
list_generation(generation) Species names in a generation
clear_cache() Clear the in-memory API cache

Notes

  • An internet connection is required for the first lookup of a resource.
  • Successful responses are cached in memory for 30 minutes.
  • API errors raise PokemonAPIError; missing resources raise PokemonNotFoundError.
  • PokéAPI data and availability are controlled by the PokéAPI project.
  • Pokémon and related names are trademarks of their respective owners. This is an unofficial fan-made library and is not affiliated with Nintendo, Game Freak, or The Pokémon Company.

License

MIT

Metadata

Release files for pypokedex-toolkit 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypokedex-toolkit 1.0.0
File Size Uploaded Provenance Actions
pypokedex_toolkit-1.0.0.tar.gz 5.7 kB Without provenance Details for pypokedex_toolkit-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pypokedex-toolkit 1.0.0
File Interpreter ABI Platform Actions
pypokedex_toolkit-1.0.0-py3-none-any.whl Python 3 none any Details for pypokedex_toolkit-1.0.0-py3-none-any.whl

Total release size: 11.3 kB

Release files / pypokedex_toolkit-1.0.0.tar.gz

Download URL pypokedex_toolkit-1.0.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
634b931d6b419c417b7b4d1ee802de6d71dc8c58699be87f16670dbf35cfc09d
BLAKE2b-256 checksum
How to use checksums
f24f4ce4f42a2b637a1ca5a91198383e1bc56d8e4aa76ea773d2cec7dec51e6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / pypokedex_toolkit-1.0.0-py3-none-any.whl

Download URL pypokedex_toolkit-1.0.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75d17d46b92d0ddf64f3bd3b06717850717a3b9e2df94f8c77c663e63b65bbb9
BLAKE2b-256 checksum
How to use checksums
818f81c6e245138436a59fa13342081c1a357ebc2abd4d75884ea533eeb8995d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for pypokedex-toolkit 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page