I don't really feel like working on this wrapper anymore, it was a decent learning experience but other then that I find it pretty boring overall to work on it, sorry.
An, in the works, asynchronous wrapper for the PokeAPI.co API.
The documentation is available at readthedocs or on gitlab pages, mostly as a backup.
The wrapper is available on PyPi and requires Python 3.5.3+, to install it just run the following command:
python3 -m pip install -U async_pokepy
# or on Windows
py -3 -m pip install -U async_pokepy
To install the development version, do the this instead:
git clone https://github.com/PendragonLore/async_pokepy.git
cd async_pokepy
python3 -m pip install -U .
It's recommended to install the library with lru-dict, to do so, run the follwing command:
pip install async_pokepy[lru]
A warning will be thrown if the wrapper is used without this extra package.
To run tests/lint install it with:
pip install async_pokepy[tests]
The best way to run tests is by using tox
.
For documentation building:
pip install async_pokepy[docs]
import asyncio
import async_pokepy
async def main(query):
client = await async_pokepy.connect()
pokemon = await client.get_pokemon(query)
fmt = ", ".join(map(str, pokemon.abilities))
print("{0} has the abilities {1}".format(pokemon, fmt))
await client.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(main("Snorlax"))
This will output: "Snorlax has the abilities Gluttony, Thick Fat, Immunity".
More examples are available in the example folder in the github repository or in the introduction section of the docs.