vk.com Python REST API wrapper
Project description
vk.com Python REST API wrapper
About
This is a vk.com (Russian social network) python API wrapper. The goal is to support all API methods: https://vk.com/dev/methods.
Getting Started
Install package using pip
pip install aiovkcom
To use VK API you need a registered app and login account in the social network.
- Sign up in vk.com
- Create standalone application.
- Save App ID.
- Use App ID, list of required permissions and user credentials to get access token.
- Use the access token to make method requests.
After signing up go to https://vk.com/dev/standalone and create application.
app_id = 'your App ID'
ImplicitSession
You can authenticate with VK API OAuth2 by passing user credentials and permissions to ImplicitSession
.
from aiovkcom import ImplicitSession
from aiovkcom.permissions import bit_scope, PERMISSIONS
phone = '+1999123456'
password = 'user password'
session = await ImplicitSession(
app_id=app_id,
login=phone, # set phone number or e-mail as login
passwd=password,
scope=bit_scope(PERMISSIONS), # get all possible permissions
v='5.101', # set version for all requests
)
List of all permissions is available here: https://vk.com/dev/permissions.
Now you can execute API requests (see Executing API requests). After authentication you will get access token session.access_token. Save it to make requests later:
access_token = session.access_token
TokenSession
If you already have an access token you can instantiate TokenSession
from aiovkcom import TokenSession
session = TokenSession(access_token, v='5.101')
and execute requests.
Executing API requests
List of all methods is available here: https://vk.com/dev/methods.
from aiovkcom import API
api = API(session)
# current user's friends
friends = await api.friends.get()
# current user's groups
groups = await api.groups.get()
List of objects is available here: https://vk.com/dev/objects
License
aiovkcom is released under the BSD 2-Clause 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
Built Distribution
File details
Details for the file aiovkcom-0.0.4.tar.gz
.
File metadata
- Download URL: aiovkcom-0.0.4.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0386b20a3047fb0a6aabe1fa21ee1c735cca50a43b150b36c56c57826f2c7b64 |
|
MD5 | 9161b9f616bb2acbd48e27373d572ba0 |
|
BLAKE2b-256 | f964e2f4bc9da4e6f2927602c0ba123a5a73da75544ea8fa2c74a9b40943397e |
File details
Details for the file aiovkcom-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: aiovkcom-0.0.4-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 535a9e92dd0ab60ee7189466ae88b81e30108e2e598dda52db7a21622344869e |
|
MD5 | d57f03068c5a5a365458779768eec4c7 |
|
BLAKE2b-256 | ba26b2740db40482b2375f243c9d4af5ce39bc36265695fe2117e96231efb768 |