Skip to main content

A simple async Python wrapper for nekos.best API.

Project description

nekos-best.py

PyPI

A simple async Python wrapper for nekos.best API.

Join the official Discord server here.

Requirements

  • aiohttp (>=3.6.2)

Installation

Make sure to have pip installed in your environement. It will also install all requirements.

pip install nekosbest

Example

import asyncio
from nekosbest import Client

client = Client()


async def get_single_image(category: str):
    result = await client.get_image(category)
    print(result)


async def get_multiple_images(category: str, amount: int):
    result = await client.get_image(category, amount)
    print(result)


loop = asyncio.get_event_loop()
loop.run_until_complete(get_single_image("nekos"))
# <Result url=https://nekos.best/nekos/0162.png>
loop.run_until_complete(get_multiple_images("nekos", 5))
# <Result url=['https://nekos.best/nekos/0277.png', 'https://nekos.best/nekos/0339.png', 'https://nekos.best/nekos/0391.png', 'https://nekos.best/nekos/0245.png', 'https://nekos.best/nekos/0225.png']>

Migrate from 0.x.x to 1.0.0

Client.teardown has been removed, it is no longer needed to pass it when closing.

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

nekosbest-1.0.11.tar.gz (15.5 kB view hashes)

Uploaded Source

Built Distribution

nekosbest-1.0.11-py3-none-any.whl (18.2 kB view hashes)

Uploaded Python 3

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