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 typing import Union

from nekosbest import Client, Result

client = Client()


async def get_img(type: str, amount: int = 1) -> Union[Result, list[Result]]:
    result = await client.get_image(type, amount)
    print(result)

loop = asyncio.get_event_loop()

loop.run_until_complete(get_img("nekos"))
# <Result url=https://nekos.best/api/v1/nekos/0356.jpg artist_href=https://www.pixiv.net/en/users/38378485 artist_name=奥馬 source_url=https://www.pixiv.net/en/artworks/88188062>
loop.run_until_complete(get_img("nekos", 2))
# [<Result url=https://nekos.best/api/v1/nekos/0072.jpg artist_href=https://www.pixiv.net/en/users/12191 artist_name=こみやひとま source_url=https://www.pixiv.net/en/artworks/66834141>, <Result url=https://nekos.best/api/v1/nekos/0215.jpg artist_href=https://www.pixiv.net/en/users/3684923 artist_name=ひゅらさん source_url=https://www.pixiv.net/en/artworks/79697176>]

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.4.tar.gz (16.0 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.4-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nekosbest-1.1.4.tar.gz
  • Upload date:
  • Size: 16.0 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.4.tar.gz
Algorithm Hash digest
SHA256 56c5023180ec942c4ae2f755e75e8e53746e3172df32fe3372cdcf72ba241a7e
MD5 037177bef99039d5629ca0f2125c1b26
BLAKE2b-256 d27f1d8fe591799c759699b7123d765c5b3b6668f14f53e915d6d66e10783524

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nekosbest-1.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ffd608d4f5dd43704c6ecb34a3801ca360a6edb1b298bf2b1dff9d1265d01ceb
MD5 284d882b0e88550e74ea61a3a866df93
BLAKE2b-256 9a5f967cc7262ab3fc4bff672c238feff322369a67703b7f82c69b23695970fb

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