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.
Release files for wayscloud 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wayscloud-0.3.0.tar.gz | 16.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wayscloud-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.9 kB
Release files / wayscloud-0.3.0.tar.gz
| Download URL | wayscloud-0.3.0.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b081dc5285162d5bc191141c98e39c2c0d7171144c5af4269709f18878faf445
|
|
BLAKE2b-256 checksum How to use checksums |
a0d1a5784b7fe4b708ebd019878eeddebdf4b96f01ab3f4af909d0a92f75ef9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / wayscloud-0.3.0-py3-none-any.whl
| Download URL | wayscloud-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b10680d495c753f3b8dfe47a3a7e82abdc1e5376996fb3f1470931a60f28634a
|
|
BLAKE2b-256 checksum How to use checksums |
c9142feb308b24f833d46770fe5c9555e8a4f3dcdb26c7c7608ca1c5df1d5977
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|