Skip to main content

Python library for interacting with the vShield API.

Project description

vshieldpy

A library designed to ease the use of the vShield API when using python. Almost all functionality of the API is implemented, and with proper exceptions.

Ruff Read the Docs Testing and Linting License: MIT

NOTE: This is an unofficial library for the vShield API. There-for vShield is not responsible for any issues regarding this library.

vShield Blue Banner

Supported Products:

All products do have support, however virtual servers (VPS, VDS and VDS-PRO) have priority in testing and ease of use as that is what I can test for.

Documentation:

Online Version:

You can read the online version of the documentation here. You can also download the offline version from the documentation page if preferred.

Building it yourself:

After cloning the repository, you must install the library with the "docs" tag.

python -m pip install ".[docs]"

Once it is done, all of the dependencies required to build the documentation will be installed.

You can now build the documentation with a single command.

python -m sphinx docs/ docs/_build

The built documentation will be stored in the docs/_build directory of the project. Now you can simply open the index.html file in your browser of choice, and get started.

Examples:

REPL:

Example for creating a client and sending a request to check the accounts current balance.

>>> # For use via the repl, "python -m asyncio" is more practical since its easier to use with async functions.
>>> from vshieldpy import Client
>>> client = Client("YOUR_TOKEN")
>>> await client.fetch_balance()
'0.00'

NOTE: For an implementation example in an application such as a discord bot, feel free to check out the examples.

Contribution:

The library does cover all API paths, however, there are a few small things missing.

  • Setting a wallpaper for a server. (This is only doable if you have reseller access)
  • Tasks are not stored in the instance of a server, said tasks are only returned by /server/getInfo/<server_id>.
  • The ease of use of the library might be lacking for various use cases such as hosting a reseller website. I am open to ways this can be improved.
  • Implementing testing for exceptions. Most important ones are already implemented, however a few (mainly parameter exceptions) are not tested.

For non-breaking and/or small changes feel free to create a PR. If not create an issue so a solution can be discussed.

You can install all the dependencies needed for development using the "dev" tag as shown below.

pip install ".[dev]"

This will install the dev dependencies needed for testing, linting, and formatting.

For formatting and linting ruff is used.

You can run python -m ruff check, and python -m ruff format in the project to check if there is any issues.

For testing pytest is used.

You can simply run python -m pytest in the project directory to start the tests.

NOTE: I would like to give a special thanks to "TheDarkest" over at vShield for helping me out in understanding various parts of the vShield API.

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

vshieldpy-0.0.2.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

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

vshieldpy-0.0.2-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file vshieldpy-0.0.2.tar.gz.

File metadata

  • Download URL: vshieldpy-0.0.2.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for vshieldpy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0a75bc5d47330ae6c0850daca4d16d83dd68b7ea99821b181796b5b3d9b2b03c
MD5 ba28a6f04d4aaa5621718ca9725cd0fe
BLAKE2b-256 ba9fddebbf271a824a68b87b00c88ed55f84c9072c362f3aa7f8331b4e9bdd7b

See more details on using hashes here.

File details

Details for the file vshieldpy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: vshieldpy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for vshieldpy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ab181be3e0429d2ddd90dbb80df547140f6219b7e0922ab80e99df750b333e8b
MD5 1da252fd1f622d6f2db726f78be27119
BLAKE2b-256 10ac5cdbb1502c21982ba475df9fbfda7d38c44957a1478a4e760c4ed82c077c

See more details on using hashes here.

Supported by

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