Skip to main content

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")

Kubernetes

client.kubernetes manages Managed Kubernetes clusters (PAT scopes kubernetes:read / kubernetes:write). Create and delete are asynchronous: the API answers 202 with status provisioning / deleting, and wait() blocks until the cluster is running, error, or gone.

# Catalogue
client.kubernetes.plans(region="no", kind="node")
client.kubernetes.regions()
client.kubernetes.versions()
client.kubernetes.estimate(
    plan_code="k8s-cluster-dev",
    node_pools=[{"name": "default", "plan_code": "k8s-node-2c4g", "count": 2}],
)

# Clusters
cluster = client.kubernetes.create(
    "shop",
    node_pools=[{"name": "default", "plan_code": "k8s-node-2c4g", "count": 2}],
    ssh_key_ids=["<ssh-key-id>"],
)
cluster = client.kubernetes.wait(cluster["id"])

client.kubernetes.list()
client.kubernetes.get(cluster["id"])
client.kubernetes.history(cluster["id"])
client.kubernetes.delete(cluster["id"], confirm_name="shop")

# Node pools (labels, taints, per-pool SSH keys)
client.kubernetes.add_node_pool(
    cluster["id"], "workers", "k8s-node-2c4g", 3,
    labels={"role": "worker"},
    taints=[{"key": "dedicated", "value": "gpu", "effect": "NoSchedule"}],
    ssh_key_ids=["<ssh-key-id>"],
)
client.kubernetes.scale_node_pool(cluster["id"], "workers", 5)
client.kubernetes.delete_node_pool(cluster["id"], "workers")

# Access — the kubeconfig is a secret; restrict the API to your CIDRs
client.kubernetes.kubeconfig(cluster["id"])  # YAML text
client.kubernetes.set_api_access(cluster["id"], ["203.0.113.7/32"])

# Public IPs and reverse DNS (allocate/release return the updated cluster)
cluster = client.kubernetes.allocate_ip(cluster["id"])
address = cluster["public_ips"][-1]["address"]
client.kubernetes.set_ptr(cluster["id"], address, "shop.example.com")
client.kubernetes.release_ip(cluster["id"], address)

# Backups
client.kubernetes.backup_policy(cluster["id"])
client.kubernetes.set_backup_policy(cluster["id"], schedule_cron="0 3 * * *", retention_days=14)
client.kubernetes.backups(cluster["id"])
client.kubernetes.backup_now(cluster["id"])
client.kubernetes.restore(cluster["id"], "<backup-id>")

# Upgrades — no backup is taken automatically, create one first
client.kubernetes.available_upgrades(cluster["id"])
client.kubernetes.upgrade(cluster["id"], "1.34")

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

Changelog

See CHANGELOG.md.

License

MIT — see LICENSE.

Release files for wayscloud 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wayscloud 0.4.0
File Size Uploaded
wayscloud-0.4.0.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wayscloud 0.4.0
File Interpreter ABI Platform
wayscloud-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.5 kB

Release files / wayscloud-0.4.0.tar.gz

Download URL wayscloud-0.4.0.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d63cf48d08bce54a82c5baa09c661b7a7671c820395c436d1c478128a805e9e3
BLAKE2b-256 checksum
How to use checksums
8cd1a3ef8a88166964f99e49e035994cfbfe4cd92920bd0ec7fa293b6d575ec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / wayscloud-0.4.0-py3-none-any.whl

Download URL wayscloud-0.4.0-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7f10eb0262a877c575c619df530e65cd6788e5c9bfdff4725732814771266bb
BLAKE2b-256 checksum
How to use checksums
449ae9b8703a3c1d882b0cbddff15ff0f90cd045af90061f5888b844f70cae80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page