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.1.0.tar.gz (3.0 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.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tradevps-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 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.1.0.tar.gz
Algorithm Hash digest
SHA256 a9517edb93c54f05f7b88a00fd2c16bea0c857eb99336e6630be026f34d76827
MD5 2c5888155615ee584a482dee01428637
BLAKE2b-256 8db9f3a98ef150b6dabe0f09949007194f4844aae66f2247868890900fedc28e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tradevps-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0db260f714a2ce5d278dc1d5413fbf9cd80f384601165d0f85f4c2b5d60585b7
MD5 43fc131ca44e952b7d52054c9a56ec0e
BLAKE2b-256 ea0ac42762e5961c33d900af11aecfa2aca21f2c11857caa12f66b73bc1b345e

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