Skip to main content

Asynchronous API wrapper for Sankaku Complex.

Project description

Sankaku Complex
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 of types[]=1


Documentation: https://zerex290.github.io/sankaku

API Reference: https://zerex290.github.io/sankaku/api

Source code: https://github.com/zerex290/sankaku


Requirements

  • Python 3.11+
  • aiohttp
  • pydantic
  • loguru

Installation

To install sankaku via pip write following line of code in your terminal:

pip install sankaku

To install the sankaku via Docker, you can follow these steps:

Step 1: Install Docker

Ensure that Docker is installed on your machine. If Docker is not already installed, you can download and install it from the official Docker website.

Step 2: Use docker to install sankaku

Open a command prompt. Navigate to the directory where you want to install Sankaku. Type the following command:

git clone https://github.com/zerex290/sankaku.git
cd sankaku
docker run -it --name sankaku -w /opt -v$(pwd):/opt python:3.11 bash

Usage 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.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

sankaku-1.0.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file sankaku-1.0.1.tar.gz.

File metadata

  • Download URL: sankaku-1.0.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for sankaku-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d4f89181f687c066ffac4d62beb1c185402cffc3f6302635e65cab94798b4784
MD5 edd115b63cd3f4a17e97ee0e5e0de4ae
BLAKE2b-256 3b722b177d94292dbf5a1538dfcf1cf142d5a304d51ae3e2554c8687730f9404

See more details on using hashes here.

File details

Details for the file sankaku-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sankaku-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for sankaku-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a285dde3caaa43ae66738b83dc64377f36d4a3a6b914d008fc0fe7d58bfa564
MD5 5d94ad40968d443d812fded0f152a3c8
BLAKE2b-256 f2f9687cd6053ee26d4c5db0d327d5cbec98489976e69ae7e07134441f414884

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