Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isosnovik/vkapi
Simple vk API for Python
https://github.com/isosnovik/vkapi
python python-2 python-3 vk vk-api
Last synced: 26 days ago
JSON representation
Simple vk API for Python
- Host: GitHub
- URL: https://github.com/isosnovik/vkapi
- Owner: ISosnovik
- Created: 2017-03-05T11:31:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-11T22:59:34.000Z (over 6 years ago)
- Last Synced: 2024-10-10T23:22:55.776Z (26 days ago)
- Topics: python, python-2, python-3, vk, vk-api
- Language: Python
- Homepage:
- Size: 46.9 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VK API
This is an ultimate library for **vk.com** API written in Python.
## Installation
Just:
```bash
git clone https://github.com/ISosnovik/vkAPI
cd vkAPI
python setup.py install
```## General use
To begin with:
```python
from vkapi.methods import *
```You can use it exactly as it is described [here](https://vk.com/dev/methods).
For example:```python
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:
```python
from vkapi.methods import *
from vkapi import ConfigConfig.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:
```profile
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](https://github.com/ISosnovik/vkAPI/tree/master/examples) of use of *__vkapi__*.+ [Public Methods](https://github.com/ISosnovik/vkAPI/blob/master/examples/Public%20methods.ipynb)
+ [Getting a Token](https://github.com/ISosnovik/vkAPI/blob/master/examples/Getting%20a%20token.ipynb)
+ [Private Methods](https://github.com/ISosnovik/vkAPI/blob/master/examples/Private%20methods.ipynb)
+ [Execute](https://github.com/ISosnovik/vkAPI/blob/master/examples/Execute.ipynb)