Skip to main content

Python Mail.Ru API wrapper

Project description

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

aiomailru

aiomailru is a python Mail.Ru API wrapper. The main features are:

Usage

To use Mail.Ru API you need a registered app and Mail.Ru account. For more details, see aiomailru 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 (private key) in publicly available code.

from aiomailru import ClientSession, API

session = ClientSession(app_id, private_key, access_token, uid)
api = API(session)

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

Use access_token and uid that were received after authorization. For more details, see authorization instruction.

Server application

Use ServerSession when REST API is needed in:

  • a server component of the client-server application

  • requests from your servers

from aiomailru import ServerSession, API

session = ServerSession(app_id, secret_key, access_token)
api = API(session)

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

Use access_token that was received after authorization. For more details, see authorization instruction.

Installation

$ pip install aiomailru

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

aiomailru 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

aiomailru-0.1.1.post1.tar.gz (20.0 kB view hashes)

Uploaded Source

Built Distribution

aiomailru-0.1.1.post1-py3-none-any.whl (23.4 kB view hashes)

Uploaded Python 3

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