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 -U 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/0338.png source_details=<SourceDetails artist_href=https://www.pixiv.net/en/users/28136401 artist_name=PiAn source_url=https://www.pixiv.net/en/artworks/91363666>>
loop.run_until_complete(get_multiple_images("nekos", 5))
# <Results url=['https://nekos.best/nekos/0351.png', 'https://nekos.best/nekos/0442.png', 'https://nekos.best/nekos/0436.png', 'https://nekos.best/nekos/0307.png', 'https://nekos.best/nekos/0009.png'] source_details=[<SourceDetails artist_href=https://www.pixiv.net/en/users/7331947 artist_name=xoaiu source_url=https://www.pixiv.net/en/artworks/87593460>, <SourceDetails artist_href=https://www.pixiv.net/en/users/37889769 artist_name=タン塩 source_url=https://www.pixiv.net/en/artworks/89459198>, <SourceDetails artist_href=https://www.pixiv.net/en/users/38808847 artist_name=Elliot source_url=https://www.pixiv.net/en/artworks/89283107>, <SourceDetails artist_href=https://www.pixiv.net/en/users/43296648 artist_name=楠シノ source_url=https://www.pixiv.net/en/artworks/86584286>, <SourceDetails artist_href=https://www.pixiv.net/en/users/32933178 artist_name=しずりゆき source_url=https://www.pixiv.net/artworks/85664088>]>

Breaking changes

Migrate from 0.x.x to 1.0.0

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

Migrate from 1.0.20 to 1.1.0

nekosbest.Result.source_details has been removed. Source details are now in Result.
And therefore, nekosbest.Results and nekosbest.SourceDetails got removed too.

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.1.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nekosbest-1.1.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file nekosbest-1.1.0.tar.gz.

File metadata

  • Download URL: nekosbest-1.1.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for nekosbest-1.1.0.tar.gz
Algorithm Hash digest
SHA256 278c905627434d457a11b1738da20a3df842ad1034d3610a5d5995906f4e4cc5
MD5 01ac4984fb03c4b65f06253a0ba8eef1
BLAKE2b-256 a3c120872b3b26cff49556c6982b79bbe580ece1fcc313cf7f3c1e551b5ada37

See more details on using hashes here.

File details

Details for the file nekosbest-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: nekosbest-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for nekosbest-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dcf52b11229a2c47f67d7a9ffcc5695c3f56cc83b3d7526cf8f75691be6f0ee
MD5 d5e67d8183a750fe544d50105d32e508
BLAKE2b-256 90eaf78815d6f7a24db2e5fdbcdf72627af3b30440747aca17f14880244113f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page