vk.com API python wrapper for asyncio
Project description
vk.com API python wrapper for asyncio
for old version of python you can use https://github.com/dimka665/vk
Features
asynchronous
support only python 3.5
have one dependency aiohttp
support two-factor authentication
Install
pip install aiovk
Examples
Annotation
In all the examples below, I will give only the {code}
async def func():
{code}
loop = asyncio.get_event_loop()
loop.run_until_complete(func())
VK API
First variant:
>>> session = TokenSession()
>>> api = API(session)
>>> await api.users.get(user_ids=1)
[{'first_name': 'Pavel', 'last_name': 'Durov', 'id': 1}]
Second variant:
>>> session = TokenSession()
>>> api = API(session)
>>> await api('users.get', user_ids=1)
[{'first_name': 'Pavel', 'last_name': 'Durov', 'id': 1}]
Also you can add timeout argument for each request or define it in the session
See https://vk.com/dev/methods for detailed API guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiovk-0.2.tar.gz
(4.9 kB
view hashes)