Skip to main content

Official Python client for TradeVPS APIs

Project description

TradeVPS Python Client

The official Python client for TradeVPS APIs.

Installation

pip install tradevps

Quick Start

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

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

tradevps-0.2.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

tradevps-0.2.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file tradevps-0.2.0.tar.gz.

File metadata

  • Download URL: tradevps-0.2.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.20.1 CPython/3.8.18 Linux/6.8.0-1021-azure

File hashes

Hashes for tradevps-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bbf8f552883e4b4bb8602398a8cef911616484c271f12ee509c9a5b73d23ac3d
MD5 453b15afa66d8e0eb34104d28b81f749
BLAKE2b-256 085e79cb4ffaa18b34d597ef1fa5e44741bc425355e44b4ad481616123f2e7e4

See more details on using hashes here.

File details

Details for the file tradevps-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tradevps-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.20.1 CPython/3.8.18 Linux/6.8.0-1021-azure

File hashes

Hashes for tradevps-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6f422d2a909a0b7916d13d9c7bbc24dd966777a9d68de36d544e905e7115c68
MD5 9dfa20d0dfa3d5fc8c5e426646b29e79
BLAKE2b-256 5c6dcb95b0c7185f21d3546819b52efe0b449160bbdf2159262aa4f7c064f071

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