Skip to main content

ok.ru Python REST 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://img.shields.io/badge/docs-latest-brightgreen.svg https://travis-ci.org/KonstantinTogoi/aiookru.svg

aiookru

aiookru is a ok.ru python 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:

  • a client component of the client-server application

  • a 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, session_secret_key)
api = API(session)

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

Pass session_secret_key that was received after authorization. For more details, see aiookru Documentation.

Server application

Use ServerSession when REST API is needed in:

  • a 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 access_token that was received after authorization. For more details, see aiookru Documentation.

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.

Source Distribution

aiookru-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

aiookru-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file aiookru-0.1.0.tar.gz.

File metadata

  • Download URL: aiookru-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.5.6

File hashes

Hashes for aiookru-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5cae3604d7581ea2100d7da5a0cee93a14a21a79f1611c353167958df8163155
MD5 b2e8801ef0bda1c2989403d0da31e20c
BLAKE2b-256 32a4de3f95a66a224f07b68d45b8a5bdcd1725aa9a940eb92424cc934a394ebf

See more details on using hashes here.

File details

Details for the file aiookru-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aiookru-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.5.6

File hashes

Hashes for aiookru-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de6fb78c9d5dd97a1b8ced6cce9c0c7a6c55a342fb2b23b71e788078178f3800
MD5 71e2d72733dc12887f5bd034526c45e4
BLAKE2b-256 31570648c7903167c7d2ad06ad752c76493f0edfcffab2ddf0adac30a6a518a0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page