Skip to main content

Vk Connections: the shortest path from one vk user to another

Library that finds the shortest path from one vk user to another through friends.

VkConnection classes

class Create(keys)

Parametrs:

  • keys - list of 4 Vk api keys (user or community access)

Note that keys is a list with exactly 4 api keys, this requires fast work of library (each request being processed under 30 sec)

Methods of Create class

getConnection(userFrom, userTo)

Parameters:

  • userFrom – id/nickname/link to user A
  • userTo – id/nickname/link to user B

Result: A list of lists of dictionaries {id: person_id, full_name: person_full_name, photo: person_photo}

printResult(result) - prints the result from main method

Installation

pip install vkconnections

Example

import vkconnections

# Vk API Keys
firstKey = 'XXX'
secondKey = 'XXX'
thirdKey = 'XXX'
fourthKey = 'XXX'

keys = [firstKey, secondKey, thirdKey, fourthKey]  # all the keys in one list

vk = vkconnections.Create(keys)  # creating an instance of a class

# users for making a way
userFrom = "alsu"
userTo = "dm"

result = vk.getConnection(userFrom, userTo)  # receiving a result
vk.printConnection(result)  # printing result

Output:



Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vkconnections-0.0.6.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vkconnections-0.0.6-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file vkconnections-0.0.6.tar.gz.

File metadata

  • Download URL: vkconnections-0.0.6.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for vkconnections-0.0.6.tar.gz
Algorithm Hash digest
SHA256 0cb93288e22cf5b7f4a35f6b216e32445f200d0a61a93185b79f6d0fe3c03259
MD5 444f7c90967c4f139879c9a6595c471c
BLAKE2b-256 c44a56ab0026033212c31d2188d84a89d96985ab8acde9c27ef93bfb03961e94

See more details on using hashes here.

File details

Details for the file vkconnections-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: vkconnections-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for vkconnections-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0aa1689aeb218b92a25d817f2ae30809a9b7e0973bc66f60dcd7ad8ab663afc3
MD5 1c8c7d76df210554e27722e2caf0fd01
BLAKE2b-256 16ed91af4443a09c7ae89c689ec5054529315a375ebd9b4d4f4b16b9158d28f8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.8

2 files

0.0.7

2 files

This release

0.0.6 This release

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page