Skip to main content

Official Python SDK for the WAYSCloud API

Project description

WAYSCloud Python SDK

Official Python SDK for the WAYSCloud API.

Installation

pip install wayscloud

Authentication

from wayscloud import WaysCloudClient

# Personal Access Token
client = WaysCloudClient(token="wayscloud_pat_...")

# API key
client = WaysCloudClient(api_key="wayscloud_api_...")

# Environment variables (WAYSCLOUD_TOKEN or WAYSCLOUD_API_KEY)
client = WaysCloudClient()

Priority: explicit arguments > environment variables.

Usage

# VPS
for vm in client.vps.list():
    print(vm["hostname"], vm["status"])

# DNS
client.dns.create_record(
    "example.com",
    record_type="A",
    name="www",
    value="192.0.2.1",
)

# Database
db = client.database.create(name="prod", db_type="postgresql")

# Apps
app = client.apps.create(name="my-app", region="eu")

# Storage
client.storage.create_bucket("my-bucket")

# SMS
client.sms.send(to="+4712345678", message="Hello from WAYSCloud")

Error handling

from wayscloud import NotFoundError, AuthenticationError

try:
    client.vps.get("id")
except NotFoundError:
    print("Not found")
except AuthenticationError:
    print("Invalid credentials")

All exceptions inherit from WaysCloudError.

Configuration

Parameter Environment variable Default
token WAYSCLOUD_TOKEN
api_key WAYSCLOUD_API_KEY
base_url WAYSCLOUD_API_URL https://api.wayscloud.services
timeout 30.0

Retries

Automatic retries on 429, 502, 503, 504 with exponential backoff. Respects Retry-After headers.

Requirements

  • Python 3.10+
  • httpx

License

MIT — see 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

wayscloud-0.2.3.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

wayscloud-0.2.3-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file wayscloud-0.2.3.tar.gz.

File metadata

  • Download URL: wayscloud-0.2.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wayscloud-0.2.3.tar.gz
Algorithm Hash digest
SHA256 f157be9934bb6222e828f2d986788f5313a99062a2ca7aacfe78617e332f254a
MD5 288b60c2249e43e9f51e9738e407d602
BLAKE2b-256 97956466c4c95f3f63d25ca57e765595ec72aab8a59a68699797a55447dc2d9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for wayscloud-0.2.3.tar.gz:

Publisher: publish.yml on wayscloudas/wayscloud-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wayscloud-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: wayscloud-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wayscloud-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13fec8c63bde3d7a93c7aa16b18720a49078325f623ed6aa563da492357f7d74
MD5 33e962d568ab4cf3152b4c64a8a465a2
BLAKE2b-256 09a1688e2112b1925865aa3c51870d7ef2ab290687ac791269a5b527e8c30ede

See more details on using hashes here.

Provenance

The following attestation bundles were made for wayscloud-0.2.3-py3-none-any.whl:

Publisher: publish.yml on wayscloudas/wayscloud-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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