Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/konstantintogoi/aiomailru
Python Mail.Ru API wrapper
https://github.com/konstantintogoi/aiomailru
api asyncio asyncio-api-wrapper mailru mymail rest
Last synced: about 2 months ago
JSON representation
Python Mail.Ru API wrapper
- Host: GitHub
- URL: https://github.com/konstantintogoi/aiomailru
- Owner: konstantintogoi
- License: bsd-2-clause
- Created: 2019-05-20T01:27:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-04T20:04:59.000Z (5 months ago)
- Last Synced: 2024-11-01T23:52:31.408Z (2 months ago)
- Topics: api, asyncio, asyncio-api-wrapper, mailru, mymail, rest
- Language: Python
- Homepage:
- Size: 575 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://img.shields.io/badge/license-BSD-blue.svg
:target: https://github.com/konstantintogoi/aiomailru/blob/master/LICENSE.. image:: https://img.shields.io/pypi/v/aiomailru.svg
:target: https://pypi.python.org/pypi/aiomailru.. image:: https://img.shields.io/pypi/pyversions/aiomailru.svg
:target: https://pypi.python.org/pypi/aiomailru.. index-start-marker1
aiomailru
=========aiomailru is a python `Mail.Ru API `_ wrapper.
The main features are:* authorization (`Authorization Code `_, `Implicit Flow `_, `Password Grant `_, `Refresh Token `_)
* `REST API `_ methods
* web scrapersUsage
-----To use `Mail.Ru API `_ you need a registered app and
`Mail.Ru `_ account.
For more details, see
`aiomailru Documentation `_.Client application
~~~~~~~~~~~~~~~~~~Use :code:`ClientSession` when REST API is needed in:
- a client component of the client-server application
- a standalone mobile/desktop applicationi.e. when you embed your app's info (private key) in publicly available code.
.. code-block:: python
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 :code:`access_token` and :code:`uid`
that were received after authorization. For more details, see
`authorization instruction `_.Server application
~~~~~~~~~~~~~~~~~~Use :code:`ServerSession` when REST API is needed in:
- a server component of the client-server application
- requests from your servers.. code-block:: python
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 :code:`access_token` that was received after authorization.
For more details, see
`authorization instruction `_.Installation
------------.. code-block:: shell
$ pip install aiomailru
or
.. code-block:: shell
$ python setup.py install
Supported Python Versions
-------------------------Python 3.5, 3.6, 3.7 and 3.8 are supported.
.. index-end-marker1
Test
----Run all tests.
.. code-block:: shell
$ python setup.py test
Run tests with PyTest.
.. code-block:: shell
$ python -m pytest [-k TEST_NAME]
License
-------aiomailru is released under the BSD 2-Clause License.