vklancer

Simple usage vk.com API.


Keywords
vk, com, API, vklancer
License
MIT
Install
pip install vklancer==1.4.0

Documentation

VKLancer

Simple usage API vk.com.

Build Status Coverage Status PyPI

Installation

pip install vklancer

Usage

List of methods: https://vk.com/dev/methods

Simple usage

from vklancer import api

vk = api.API()
response = vk.users.get(user_ids=1)

print(response)

>>> {'response': [{'last_name': 'Дуров', 'id': 1, 'first_name': 'Павел'}]}

With request method

from vklancer import api

vk = api.API()
response = vk.request('users.get', user_ids=1)

print(response)

>>> {'response': [{'last_name': 'Дуров', 'id': 1, 'first_name': 'Павел'}]}

Get method call URL

from vklancer import api

vk = api.API()
url = vk.get_url('users.get', user_ids=1)

print(url)

>>> https://api.vk.com/method/users.get?user_ids=1&v=5.49

With special version API

from vklancer import api

vk = api.API(token='your access token', version='4.0')
response = vk.users.get(user_ids=1)

print(response)

>>> {'response': [{'last_name': 'Дуров', 'id': 1, 'first_name': 'Павел'}]}

Obtain access token

from vklancer import api
from vklancer import utils

access_token = utils.oauth('your login', 'your password')

vk = api.API(token=access_token, version='5.37')
response = vk.users.get(user_ids=1)

print(response)

>>> {'response': [{'last_name': 'Дуров', 'id': 1, 'first_name': 'Павел'}]}

Tests

tox

Changelog

See CHANGELOG.md

License

See LICENSE