🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

async-pokepy

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-pokepy

A simple asynchronous wrapper for the PokeAPI.co API.

0.1.5a0
94

Supply Chain Security

100

Vulnerability

100

Quality

100

Maintenance

100

License

Network access

Supply chain risk

This module accesses the network.

Found 1 instance in 1 package

Dependencies have 2 high alerts.

High CVE

Maintainers
1

Logo async_pokepy

PyPI pyversions PyPI status PyPI license Documentation Status Pipelines Status Build Status CircleCI AppYevorCI

An, in the works, asynchronous wrapper for the PokeAPI.co API.

You can check out the (failing) pipelines @ gitlab.

Documentation

The docs are available @ readthedocs.

Installing

The wrapper is available on PyPi, you can install it with:

pip install async_pokepy

Better caching

It's very recommended to install the library with lru-dict, you can do this by installing the wrapper with this command:

pip install async_pokepy[lru]

The wrapper will throw a warning if you try to use it without this extra package.

Tests and docs

If you also want to be able to run the tests/lint install it with:

pip install async_pokepy[tests]

The best way to run tests is by using tox.

For docs building:

pip install async_pokepy[docs]

Example

import asyncio

import async_pokepy


async def main(query):
    client = await async_pokepy.Client.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".

You can check out more examples in the example folder in the github repository or in the introduction section of the docs.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts