https://github.com/tradevpsnet/client-python
The official Python client for TradeVPS APIs.
https://github.com/tradevpsnet/client-python
apis client python tradevps
Last synced: 9 months ago
JSON representation
The official Python client for TradeVPS APIs.
- Host: GitHub
- URL: https://github.com/tradevpsnet/client-python
- Owner: tradevpsnet
- License: mit
- Created: 2025-04-10T08:24:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-10T10:18:07.000Z (about 1 year ago)
- Last Synced: 2025-04-26T08:42:05.796Z (about 1 year ago)
- Topics: apis, client, python, tradevps
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# TradeVPS Python Client
The official Python client for TradeVPS APIs.
## Installation
```bash
pip install tradevps
```
## Quick Start
```python
from tradevps import Client
from tradevps.exceptions import AuthenticationError, APIError
# Initialize client
client = Client()
# Method 1: Login with email/password
try:
auth = client.login("your-email@example.com", "your-password")
print(f"Logged in as: {auth.user.name}")
# Token is automatically set after login
# You can also set it manually:
client.set_api_key(auth.token)
except AuthenticationError as e:
print(f"Authentication failed: {e}")
# Method 2: Initialize with API key directly
client = Client(api_key="your-api-key")
# Handle API errors
try:
# Your API calls here
pass
except APIError as e:
print(f"API error: {e.message} (Status: {e.status_code})")
```
## Development
1. Clone the repository
2. Install dependencies: `pdm install`
3. Run tests: `pdm run pytest`
## License
MIT License