Getting data from vk.com in a pythonic way.
Project description
VK Getter
Very simple and pythonic way to extract data from https://www.vk.com
Getting started
Install package via pip
pip install vk_getter
Firstly, you need to get your access token. You can get it here.
Just paste your token into a getter and you good to go!
from vk_getter import VKGetter
getter = VKGetter("TOKEN")
# get 100 posts from https://www.vk.com/vk
posts = getter.get_latest_posts("vk", 100)
You can specify different settings:
posts = getter.get_latest_posts(group_domain="https://www.vk.com/vk"
count=1,
include_pinned=False,
allow_no_attachments=False,
include_ads=False,
include_copyright=False)
All posts are retrieved as Python dataclasses, but can also be returned as dictionaries.
posts = getter.get_latest_posts(group_domain="vk",
count=1,
as_dict=True)
# posts[0] =
# {
# "id": 1320761,
# "date": "15.09.2022",
# "time": "14:15:11",
# "text": "...",
# "attachments": {
# "photo": [],
# "video": [
# "..."
# ],
# "audio": [],
# "other": []
# },
# "comments": 858,
# "likes": 1150,
# "reposts": 371,
# "views": 518953
# }
Also, you can download all the gathered attachments to your local system.
from vk_getter.utils import download_attachments
posts = getter.get_latest_posts("lol", 15)
getter.download_attachments(posts, path="images")
*Note: do NOT use as_dict in this method.
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
vk_getter-0.0.4.tar.gz
(5.5 kB
view details)
File details
Details for the file vk_getter-0.0.4.tar.gz.
File metadata
- Download URL: vk_getter-0.0.4.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebed5e6e70754a5687ef32db1678c7d56a83a3b4c5ff600e5b476407cf1dc872
|
|
| MD5 |
773ee659750e5f8245b700c0290b49b6
|
|
| BLAKE2b-256 |
198de5dd655ad55b7a620ed3788b1960ad71280771667e94e8862039caf69ec1
|