<h1 align="center">
<a href="https://github.com/zerex290/sankaku">
<img src="https://raw.githubusercontent.com/zerex290/sankaku/main/docs/icon.png" alt="Sankaku Complex"
width="150" height="150"/>
</a>
<div>sankaku</div>
</h1>
<p align="center"><em><b>For real men of culture </b></em></p>
## About
Asynchronous API wrapper for [Sankaku Complex](https://beta.sankakucomplex.com)
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
### Useful links
- [Documentation](https://zerex290.github.io/sankaku)
- [API Reference](https://zerex290.github.io/sankaku/api)
- [Source code](https://github.com/zerex290/sankaku)
## Requirements
- Python 3.8+
- aiohttp
- pydantic
- loguru
- aiohttp-retry
- typing_extensions; python_version < '3.10'
## Installation
### Installation with pip
To install sankaku via pip write following line of code in your terminal:
```commandline
pip install sankaku
```
### Installation with Docker
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](https://www.docker.com/get-started).
#### 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:
```commandline
git clone https://github.com/zerex290/sankaku.git
cd sankaku
docker run -it --name sankaku -w /opt -v$(pwd):/opt python:3 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:
```py
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")
# Get the first 100 posts which have been added to favorites of the
# currently logged-in user:
async for post in client.get_favorited_posts(100):
print(post)
# Get every 3rd book from book pages, starting with 100th and ending with
# 400th book:
async for book in client.browse_books(100, 401, 3): # range specified in
print(book) # same way as with 'range()'
asyncio.run(main())
```
## Contributing
Feel free to contribute to sankaku after reading [CONTRIBUTING](CONTRIBUTING.md) file.
Raw data
{
"_id": null,
"home_page": "https://github.com/zerex290/sankaku",
"name": "sankaku",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "sankaku,sankakucomplex,api",
"author": "zerex290",
"author_email": "zerex290@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ef/59/bc6ceb82574e42ee17d764b9d808bb25645349dcd5bd15a0b03c3bd51972/sankaku-2.0.1.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">\n <a href=\"https://github.com/zerex290/sankaku\">\n <img src=\"https://raw.githubusercontent.com/zerex290/sankaku/main/docs/icon.png\" alt=\"Sankaku Complex\"\n width=\"150\" height=\"150\"/>\n </a>\n <div>sankaku</div>\n</h1>\n<p align=\"center\"><em><b>For real men of culture </b></em></p>\n\n## About\n\nAsynchronous API wrapper for [Sankaku Complex](https://beta.sankakucomplex.com)\nwith *type-hinting*, pydantic *data validation* and an optional *logging support*\nwith loguru.\n\n### Features\n\n- Type-hints\n- Deserialization of raw json data thanks to pydantic models\n- Enumerations for API request parameters to provide better user experience\n\n### Useful links\n\n- [Documentation](https://zerex290.github.io/sankaku)\n- [API Reference](https://zerex290.github.io/sankaku/api)\n- [Source code](https://github.com/zerex290/sankaku)\n\n## Requirements\n\n- Python 3.8+\n- aiohttp\n- pydantic\n- loguru\n- aiohttp-retry\n- typing_extensions; python_version < '3.10'\n\n## Installation\n\n### Installation with pip\n\nTo install sankaku via pip write following line of code in your terminal:\n\n```commandline\npip install sankaku\n```\n\n### Installation with Docker\n\nTo install the sankaku via Docker, you can follow these steps:\n\n#### Step 1: Install Docker\n\nEnsure that Docker is installed on your machine. If Docker is not already\ninstalled, you can download and install it from the official\n[Docker website](https://www.docker.com/get-started).\n\n#### Step 2: Use docker to install sankaku\n\nOpen a command prompt. Navigate to the directory where you want\nto install sankaku. Type the following command:\n\n```commandline\ngit clone https://github.com/zerex290/sankaku.git\ncd sankaku\ndocker run -it --name sankaku -w /opt -v$(pwd):/opt python:3 bash\n```\n\n## Usage example\n\nIt's very simple to use and doesn't require to always keep opened browser page\nwith documentation because all methods are self-explanatory:\n\n```py\nimport asyncio\nfrom sankaku import SankakuClient\n\nasync def main():\n client = SankakuClient()\n\n post = await client.get_post(25742064)\n print(f\"Rating: {post.rating} | Created: {post.created_at}\")\n # \"Rating: Rating.QUESTIONABLE | Created: 2021-08-01 23:18:52+03:00\"\n\n await client.login(access_token=\"token\")\n # Or you can authorize by credentials:\n # await client.login(login=\"nickname or email\", password=\"password\")\n\n # Get the first 100 posts which have been added to favorites of the\n # currently logged-in user:\n async for post in client.get_favorited_posts(100):\n print(post)\n\n # Get every 3rd book from book pages, starting with 100th and ending with\n # 400th book:\n async for book in client.browse_books(100, 401, 3): # range specified in\n print(book) # same way as with 'range()'\n\nasyncio.run(main())\n```\n\n## Contributing\n\nFeel free to contribute to sankaku after reading [CONTRIBUTING](CONTRIBUTING.md) file.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Asynchronous API wrapper for Sankaku Complex.",
"version": "2.0.1",
"project_urls": {
"Homepage": "https://github.com/zerex290/sankaku",
"Issue Tracker": "https://github.com/zerex290/sankaku/issues"
},
"split_keywords": [
"sankaku",
"sankakucomplex",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "47812d7d76ddd2ff93d5d1a834223cc72a0d0e53128ec2af8414ea1207abfc87",
"md5": "7f29c743d22a7ba991a5927b437fd77c",
"sha256": "8c49edce5bd8e2cf0b1a56eec125187d3670cc8114760ae996d04ea7d738ab53"
},
"downloads": -1,
"filename": "sankaku-2.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7f29c743d22a7ba991a5927b437fd77c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 24065,
"upload_time": "2023-09-17T11:48:12",
"upload_time_iso_8601": "2023-09-17T11:48:12.659579Z",
"url": "https://files.pythonhosted.org/packages/47/81/2d7d76ddd2ff93d5d1a834223cc72a0d0e53128ec2af8414ea1207abfc87/sankaku-2.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ef59bc6ceb82574e42ee17d764b9d808bb25645349dcd5bd15a0b03c3bd51972",
"md5": "7c9edc8ec200e7bb5b0d5a3184292b54",
"sha256": "b8f91c86a780e463f1b08fc4caff06b223b72aa449c10660b0627bcb809e03f1"
},
"downloads": -1,
"filename": "sankaku-2.0.1.tar.gz",
"has_sig": false,
"md5_digest": "7c9edc8ec200e7bb5b0d5a3184292b54",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 21179,
"upload_time": "2023-09-17T11:48:14",
"upload_time_iso_8601": "2023-09-17T11:48:14.592423Z",
"url": "https://files.pythonhosted.org/packages/ef/59/bc6ceb82574e42ee17d764b9d808bb25645349dcd5bd15a0b03c3bd51972/sankaku-2.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-17 11:48:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zerex290",
"github_project": "sankaku",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "sankaku"
}