https://github.com/beastmatser/aiopokeapi
An asynchronous API wrapper for the pokeapi written in Python.
https://github.com/beastmatser/aiopokeapi
async-await asynchronous pokemon-api python
Last synced: 5 months ago
JSON representation
An asynchronous API wrapper for the pokeapi written in Python.
- Host: GitHub
- URL: https://github.com/beastmatser/aiopokeapi
- Owner: beastmatser
- License: mit
- Created: 2021-09-28T18:20:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-19T10:04:30.000Z (9 months ago)
- Last Synced: 2025-09-25T04:59:24.927Z (9 months ago)
- Topics: async-await, asynchronous, pokemon-api, python
- Language: Python
- Homepage:
- Size: 7.23 MB
- Stars: 47
- Watchers: 2
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
AioPokéApi
An Asynchronous API wrapper for the PokéApi written in Python.
Report issue
·
Request feature
·
Fork project
## :old_key: Key Features
- Use of modern Python keywords: `async` and `await`.
- Every object is fully type hinted.
- Objects get cached, this increases speed and avoids unnecessary API requests.
## :earth_africa: Documentation
All endpoints of the PokéApi are accesible through methods of the `AiopokeClient`,
these methods are listed in [aiopoke_client.py](./src/aiopoke/aiopoke_client.py) and should be fairly straightforward to use.
## :comet: Installation
```sh
pip install aiopokeapi
```
:gear: Didn't work?
Depending on your Python installation, you might need to use one of the
following:
- Python is not in PATH
```sh
path/to/python.exe -m pip install aiopokeapi
```
- Python is in PATH but pip is not
```sh
python -m pip install aiopokeapi
```
- Unix systems can use pip3/python3 commands
```sh
pip3 install aiopokeapi
```
```sh
python3 -m pip install aiopokeapi
```
- Using multiple Python versions
```sh
py -m pip install aiopokeapi
```
## :rocket: Getting started
Aiopoke's goal is to be simple and easy to use:
```py
import asyncio
import aiopoke
async def main():
client = aiopoke.AiopokeClient()
ability = await client.get_ability(1)
generation = await ability.generation.fetch()
await client.close()
asyncio.run(main())
```
Or even better, using a context manager:
```py
# in main()
async with aiopoke.AiopokeClient() as client:
ability = await client.get_ability(1)
generation = await ability.generation.fetch()
```
If you are hosting the pokeapi locally and still want to use aiopokeapi,
you may pass a base url into the keyword arguments of `AiopokeClient` as follows:
```py
aiopoke.AiopokeClient(base_url="https://localhost:8080")
```