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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for vshieldpy-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7963a6d733ea782101af7aa35335eb979a9d209da6174a8042090647697fc60c |
|
MD5 | dac3dd6223772e6cd9cd5eb7c8b85ad0 |
|
BLAKE2b-256 | ad3010501153848a7b16725ce02683b4a317f5ff8da59dbc34a6bb600c4ca211 |