Skip to main content

Asynchronous api wrapper for the game from vk.com called 'slaves'

Project description

VKSlaves

Asynchronous api wrapper for the game from vk.com called "slaves"

Example of usage

import asyncio
from vkslaves import SlavesAPI
from vkslaves.errors import SlaveAreLockedError, NotEnoughMoneyError

slaves_api = SlavesAPI(
    app_auth="vk_access_token_settings=friends,status&vk_app_id=7794757..."
)


async def main():
    await slaves_api.start()  # update .me and .slaves
    print(slaves_api.me.balance)  # get your balance
    user = await slaves_api.user(1)  # get info about vk.com/id1
    print(user.master_id)  # get id of user's master
    try:
        await svales_api.buy_slave(1)
    except SlaveAreLockedError:
        print(" Oh no :( ")
    except NotEnoughMoneyError:
        print(" I need more money :( ")


asyncio.run(main())

I'm too lazy to write documentation, just look at the names of the functions and docstrings

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

VKSlaves-1.1.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

VKSlaves-1.1.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file VKSlaves-1.1.1.tar.gz.

File metadata

  • Download URL: VKSlaves-1.1.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.6

File hashes

Hashes for VKSlaves-1.1.1.tar.gz
Algorithm Hash digest
SHA256 3f1f1a09a2b0bf590ddba0aba44abcfd115cdc8bfec0ef13b8e5e35a49ddfd3d
MD5 ea847464164aed4b9b4266ef4b542f57
BLAKE2b-256 8de77687508aad2ddd703b70efbdf5f2e4f264c2bd49235baa97e1d222ea9612

See more details on using hashes here.

File details

Details for the file VKSlaves-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: VKSlaves-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.6

File hashes

Hashes for VKSlaves-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b365daf95d661c0ce6c9147bd9a74af3592a37ec5ccf144442f65761eaed415
MD5 64790d68bee4fd8dc8a6b5f31d19bc3a
BLAKE2b-256 f3052e4cba8f4d8af8b0794b13a883354c7644c39904ca583cb0c621d8aa6d90

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page