A simple async Python wrapper for nekos.best API.
Project description
nekos-best.py
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nekosbest-1.1.13.tar.gz.
File metadata
- Download URL: nekosbest-1.1.13.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5adb01393679b72f8ccf6022ed0d0c467523616e612a8ef5b23328e5c90acd8d
|
|
| MD5 |
3cc97b1b1161d8b83fc3e60d1d01b915
|
|
| BLAKE2b-256 |
6f71c936343f6f6acd25731961d5b429fe5adabb23c3b750dab8b0250c438b20
|
File details
Details for the file nekosbest-1.1.13-py3-none-any.whl.
File metadata
- Download URL: nekosbest-1.1.13-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a6b6ce0f8276d957c099245c9758dd60c0beca57d22696d2c553bc999f28e9c
|
|
| MD5 |
0a327cb452b854a10d2b0f4246ee8209
|
|
| BLAKE2b-256 |
f1cdb90d3b0b48a4f79de6ee898e8984c44585c480367243313120d696ded73e
|