Wrapper for Shikimori API
Project description
shikimori_api
Unofficial wrapper for the Shikimori API
Installation
This package requires Python 3.6 or later
pip install shikimori_api
Dependencies
Usage
from shikimori_api import Shikimori
session = Shikimori()
api = session.get_api()
api.animes.GET(search='KonoSuba', kind='movie') # GET /api/animes?search=KonoSuba&kind=movie
api.animes(1).GET() # GET /api/animes/1
api.animes(1).screenshots.GET() # GET /api/animes/1/screenshots
##OAuth
import json
def token_saver(token: dict):
with open('token.json', 'w') as f:
f.write(json.dumps(token))
session = Shikimori('APP_NAME', client_id='CLIENT_ID', client_secret='CLIENT_SECRET', token_saver=token_saver)
print(session.get_auth_url())
code = input('Authorization Code: ')
session.fetch_token(code)
After receiving and saving token, you can load it from file:
with open('token.json') as f:
token = json.load(f)
session = Shikimori('APP_NAME', client_id='CLIENT_ID', client_secret='CLIENT_SECRET',
token=token, token_saver=token_saver)
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
shikimori_api-1.0.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for shikimori_api-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da8553bab20c3a6196bf231e25a8f2ea12250d77b428997b0f0c26511166a37f |
|
MD5 | d43f4836f5714a32fc6f656c37f99a6b |
|
BLAKE2b-256 | 9eb71a10fd549c518cc3c27ff9b1cc82ec5c6f85365cae9c7f66298bba91f2a0 |