Skip to content

LICENSE Latest Release Supported Python Versions Read the Docs GitHub Pages

aiookru

aiookru is a python ok.ru API wrapper. The main features are:

Usage

To use ok.ru API you need a registered app and an access_token

import aiookru

client_id = '12345678'
application_key = 'ABCDEFGHIJKLMNOPQ'
application_secret_key = '0A1B2C3D4E5F6G7H8I9K10L11M12N13O14P15Q'
redirect_uri = 'http://apiok.ru/oauth_callback'

code = ''  # get code from login form

async with aiookru.CodeGrant(client_id, application_secret_key, redirect_uri, code) as grant:
    access_token = grant.access_token
    refresh_token = grant.refresh_token

async with aiookru.API(access_token, application_key, application_secret_key=application_secret_key) as okru:
    events = await okru.events.get()

async with aiookru.RefreshGrant(client_id, application_secret_key, refresh_token) as grant:
    access_token = grant.access_token

For more details, see authorization instruction.

Installation

pip install aiookru

Supported Python Versions

Python 3.7, 3.8, 3.9 are supported.

License

aiookru is released under the BSD 2-Clause License.