Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Python wrapper for shikimori API

Project description


Python wrapper for shikimori API


pip install pyshikiapi


from pyshikiapi import API

app_name = 'YOUR_APP_NAME'
client_id = 'YOUR_APP_CLIENT_ID'
client_secret = 'YOUR_APP_SECRET'

api = API(app_name, client_id, client_secret)
print('Please visit the link and copy authorization code:', api.authorization_url)
code = input('The code: ')

# Now you can use the api object to send requests

If you want to save the token to use it later, pass the token_update_callback argument to API:

def token_file_saver(token):  # A function which accepts 1 dict-like argument
    with open('token.json', 'w') as f:
        json.dump(token, f)

api = API(app_name, client_id, client_secret, token_update_callback=token_file_saver)

Next time you start, load the token:

with open('token.json') as f:
    token = json.load(f)
api = API(app_name, client_id, client_secret, token)


api.animes.GET(page=2, limit=10)  # will send GET-request animes?page=2&limit=10
api.animes(5).roles.GET()  # will send GET-request animes/5/roles

comment = {'body': 'hello', 'commentable_type': 'User', 'commentable_id': 4193}
api.comments.POST(comment=comment, broadcast=False)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyshikiapi, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size pyshikiapi-1.0.1-py3-none-any.whl (8.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pyshikiapi-1.0.1.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page