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://github.com/konstantintogoi/aiookru/actions/workflows/pages/pages-build-deployment/badge.svg

aiookru

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

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.

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-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

aiookru-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiookru-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.12

File hashes

Hashes for aiookru-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4170b8b4184815de9136daf0425265797633b4d8ea1552422d05c9c86d8f1ca8
MD5 54e848839593d031025d1558fb0a0417
BLAKE2b-256 ba7929bf0912af158f2762a7fb03673a97ffcf41a71d4470e8c71f3188f05590

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiookru-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.12

File hashes

Hashes for aiookru-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f751602f050dfc5133baf964193856e02dcdf59a4c9f19a8fafc7dc87fbda2fe
MD5 3a6289838c41d4291a41757f2f2127d7
BLAKE2b-256 7b1f187cf6f011a98a8192e2ef6cbc4e2bcaa93850494daa3e5f4d1596a1a6ab

See more details on using hashes here.

Supported by

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