Skip to main content

vk.com (aka vkontakte.ru) API wrapper

Project description

This is a vk.com (aka vkontakte.ru, largest Russian social network) python API wrapper. The goal is to support all API methods (current and future) that can be accessed from server.

Installation

$ pip install vkontakte

Usage

>>> import vkontakte
>>> vk = vkontakte.API('my_api_id', 'my_api_secret')
>>> print vk.getServerTime()
1282689362

>>> vk = vkontakte.API(token='my_access_token')
>>> print vk.getServerTime()
1282689362

>>> profiles = vk.getProfiles(uids='1,2', fields='education')
>>> pavel = profiles[0]
>>> print pavel['last_name'], pavel['university_name']
Дуров СПбГУ

>>> # alternative syntax
>>> profiles = vk.get('getProfiles', uids='1,2', fields='education')
>>> pavel = profiles[0]
>>> print pavel['last_name'], pavel['university_name']
Дуров СПбГУ

>>> # custom timeout example (default timeout = 1s)
>>> vk = vkontakte.API('my_api_id', 'my_api_secret', timeout=5)
>>> print vk.getServerTime()
1282689362

>>> # syntax sugar for 'secure.*' methods
>>> print vk.secure.getSMSHistory()
None

All API methods that can be called from server should be supported.

See http://bit.ly/9Nzc8h for detailed API help.

OAuth2 access_token is supported (docs are here http://vkontakte.ru/developers.php?oid=-1&p=Авторизация)

Changes

1.3 (2012-03-27)

  • dict, list and tuple arguments are now properly serialized;

  • more info is preserved in VKError.

1.2.1 (2012-02-15)

  • properly encode unicode for API calls;

  • tox test running.

1.2 (2012-01-20)

  • ‘get’ API calls are fixed;

  • tests are added.

1.1.0 (2012-01-11)

  • more magic methods are supported;

  • proper timestamp calculation.

1.0.0 (2011-12-29)

  • OAuth2 support;

  • api.ads support;

0.9.5 (2010-10-30)

  • syntax sugar for ‘secure’ methods;

  • make vkontakte.signature public;

  • unicode param names are fixed;

0.9.3 (2010-09-02)

  • timeout support

0.9.1 (2010-08-25)

Initial release.

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

vkontakte-1.3.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file vkontakte-1.3.tar.gz.

File metadata

  • Download URL: vkontakte-1.3.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for vkontakte-1.3.tar.gz
Algorithm Hash digest
SHA256 8d95128a96edfc90dddff2922ba14ffafc09e25fc46f76a1667db53a14753d9e
MD5 627f7382009d23010813263dd1190a11
BLAKE2b-256 58eb4acea3a51b503e098b4849613e52f88b1264a58505de4a0014662ae1f093

See more details on using hashes here.

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