Skip to main content

Python ok.ru API wrapper

Project description

https://img.shields.io/badge/license-BSD-blue.svg https://img.shields.io/pypi/v/aiookru.svg https://img.shields.io/pypi/pyversions/aiookru.svg https://readthedocs.org/projects/aiookru/badge/?version=latest https://travis-ci.org/KonstantinTogoi/aiookru.svg

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 ok.ru account. For more details, see aiookru Documentation.

Client application

Use ClientSession when REST API is needed in:

  • 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.

from aiookru import ClientSession, API

session = ClientSession(app_id, app_key, access_token, session_secret_key)
api = API(session)

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

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

Server application

Use ServerSession when REST API is needed in:

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

session = ServerSession(app_id, app_key, app_secret_key, access_token)
api = API(session)

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

Pass app_secret_key and access_token that was received after authorization. For more details, see authorization instruction.

Installation

pip install aiookru

or

python setup.py install

Supported Python Versions

Python 3.5, 3.6, 3.7 and 3.8 are supported.

Test

Run all tests.

python setup.py test

Run tests with PyTest.

python -m pytest [-k TEST_NAME]

License

aiookru is released under the BSD 2-Clause License.

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 aiookru, version 0.1.1.post1
Filename, size File type Python version Upload date Hashes
Filename, size aiookru-0.1.1.post1-py3-none-any.whl (9.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size aiookru-0.1.1.post1.tar.gz (9.0 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