vkAPI

Simple vk API for Python

Stars
8

VK API

This is an ultimate library for vk.com API written in Python.

Installation

Just:

git clone https://github.com/ISosnovik/vkAPI
cd vkAPI
python setup.py install

General use

To begin with:

from vkapi.methods import *

You can use it exactly as it is described here. For example:

users.get(user_ids=1, fields='city')
#[{'city': 2, 'first_name': 'Pavel', 'last_name': 'Durov', 'uid': 1}]

Access Token

Some methods use access_token. It shouldn't be passed as a parameter to method. Nevertheless, it is defined as a class property token in vkapi.vkapi.Config class. Just set it at the beginnig:

from vkapi.methods import *
from vkapi import Config

Config.token = 'h3r3-1s-th3-4cc3ss-t0k3n'
account.getInfo(fields='country')

And that is it.

Documentation

All methods are provided with short description and reference to the official documentation. If you forget something, just call help or shift + tab + tab for Jupyter Notebook and you will get the description:

Help on function resolveScreenName in module vkapi.methods.utils:

resolveScreenName(screen_name=None)
    Detects a type of object (e.g., user, community, application)
    and its ID by screen name.
    https://vk.com/dev/utils.resolveScreenName

Examples

There are several examples of use of vkapi.