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.
NOTE: This is an unofficial library for the vShield API. There-for vShield is not responsible for any issues regarding this library.
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.
Metadata
Release files for vshieldpy 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vshieldpy-0.0.2.tar.gz | 30.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vshieldpy-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.6 kB
Release files / vshieldpy-0.0.2.tar.gz
| Download URL | vshieldpy-0.0.2.tar.gz |
|---|---|
| Size | 30.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a75bc5d47330ae6c0850daca4d16d83dd68b7ea99821b181796b5b3d9b2b03c
|
|
BLAKE2b-256 checksum How to use checksums |
ba9fddebbf271a824a68b87b00c88ed55f84c9072c362f3aa7f8331b4e9bdd7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.2
|
Release files / vshieldpy-0.0.2-py3-none-any.whl
| Download URL | vshieldpy-0.0.2-py3-none-any.whl |
|---|---|
| Size | 28.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab181be3e0429d2ddd90dbb80df547140f6219b7e0922ab80e99df750b333e8b
|
|
BLAKE2b-256 checksum How to use checksums |
10ac5cdbb1502c21982ba475df9fbfda7d38c44957a1478a4e760c4ed82c077c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.2
|