Skip to content

konstantintogoi/aiookru

Repository files navigation

https://readthedocs.org/projects/aiookru/badge/?version=latest

aiookru

async python ok.ru API wrapper for REST API methods.

Usage

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

Client application

Use ClientSession for:

  • client component of the client-server application
  • standalone mobile/desktop application

i.e. when you embed your app's info (application key) in publicly available code.

import aiookru

session = ClientSession(client_id, application_key, access_token, session_secret_key)
api = API(session)

friends = await api.friends.get()
events = await api.events.get()

Pass session_secret_key and access_token that were received after authorization. For more details, see authorization instruction.

Server application

Use ServerSession for:

  • server component of the client-server application
  • requests from your servers
import aiookru

session = ServerSession(client_id, application_key, application_secret_key, access_token)
api = API(session)

friends = await api.friends.get()
events = await api.events.get()

Pass application_secret_key and access_token that was received after authorization. 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.