VKLight - Light wrapper for VK's API
Project description
VKLight
Легкая обёртка для работы с VK API.
Установка
pip install vklight
Пример использования
from vklight import VKLight, VKLightError
api = VKLight({
"access_token": "...",
"v": "5.150",
"lang": "ru",
"host": "api.vk.me"
})
try:
api.call("users.get", { "user_id": 1})
except VKLightError as e:
print(e)
# {'response': [{'id': 1, 'first_name': 'Павел', 'last_name': 'Дуров', 'is_closed': False, 'can_access_closed': True}]}
или
api("users.get", {"user_id": 1})
# {'response': [{'id': 1, 'first_name': 'Павел', 'last_name': 'Дуров', 'is_closed': False, 'can_access_closed': True}]}
Использование execute-методов
api.execute(r"return API.users.get({'user_id': 1});")
# {'response': [{'id': 1, 'first_name': 'Павел', 'last_name': 'Дуров', 'is_closed': False, 'can_access_closed': True}]}
Лицензия
MIT License
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
VKLight-1.3.8.tar.gz
(2.8 kB
view hashes)