Python library to access vkontakte social network api.
Project description
Python library to access vkontakte social network api.
Installation
Via pip:
pip install python-vkontakte
Api
import pyvkontakte
api = pyvkontakte.VkontakteApi()
api.call('users.get', user_ids=1) # [{'last_name': 'Дуров', 'id': 1, 'first_name': 'Павел'}]
or calling method via class attribute:
api.users_get(user_ids=1) # [{'last_name': 'Дуров', 'id': 1, 'first_name': 'Павел'}]
Are both the same. In a second form, it is a method name where dots replaced with underscores - wall.getById will be wall_getById and so on.
If you want to call some private api, which require access token, just create a api class with it:
pyvkontakte.VkontakteApi('access token')
Using different api version:
pyvkontakte.VkontakteApi(v='5.50')
If some error occures after api request (response json contains error insead of response key), pyvkontakte.VkontakteApiError will be raised. Special attribute json will be avaible on exception object, additionally exception str representation will contain error description and error code.
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
File details
Details for the file python-vkontakte-1.1.2.zip
.
File metadata
- Download URL: python-vkontakte-1.1.2.zip
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ecd0b49a22110f0d60d01ffff3259e33f146cd54786bf182484e0018bc6850d |
|
MD5 | 77cefe9d4c7c43fabf91ed80115bc2a5 |
|
BLAKE2b-256 | a72ce9ca0f1483a773c7dcbc114aefbbabd5b86c268da17948495301cd075cf2 |