Skip to main content

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


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)

Uploaded Source

Built Distribution

VKLight-1.3.8-py3-none-any.whl (2.8 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