Asynchronous API wrapper for Sankaku Complex.
Project description
sankaku
For real men of culture 😏
About
Asynchronous API wrapper for Sankaku Complex with type-hinting, pydantic data validation and an optional logging support with loguru.
Features:
- Type-hints
- Deserialization of raw json data thanks to pydantic models
- Enumerations for API request parameters to provide better user experience
For instance, you can type
types.TagType.ARTIST
instead oftypes[]=1
Documentation: TBA
Source code: https://github.com/zerex290/sankaku
Requirements
- Python 3.11+
- aiohttp
- pydantic
- loguru
Installation
pip install sankaku
Example
It's very simple to use and doesn't require to always keep opened browser page with documentation because all methods are self-explanatory.
import asyncio
from sankaku import SankakuClient
async def main():
client = SankakuClient()
post = await client.get_post(25742064)
print(f"Rating: {post.rating} | Created: {post.created_at}")
# "Rating: Rating.QUESTIONABLE | Created: 2021-08-01 23:18:52+03:00"
await client.login(access_token="token")
# Or you can authorize by credentials:
# await client.login(login="nickname or email", password="password")
async for book in client.get_recently_read_books():
...
asyncio.run(main())
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
sankaku-1.0.0.tar.gz
(18.9 kB
view hashes)
Built Distribution
sankaku-1.0.0-py3-none-any.whl
(20.4 kB
view hashes)