Skip to main content

Vertra Cloud Python SDK

PyPI License: MIT

Official Python SDK for the Vertra Cloud public API: apps, databases, snapshots, account, workspaces and billing — one typed method per route.

  • Python 3.10+, fully typed (py.typed), with TypedDict payloads.
  • Zero dependencies outside the standard library.
  • No hidden retries, caching or state: errors come back as they happened.

Installation

pip install vertracloud-api

Getting an API key

Sign in to the dashboard, open Settings → API keys and create a key with only the scopes your code needs (e.g. apps:read, apps:write). Keep it out of your source code — the examples read it from VERTRA_API_KEY.

Quick start

import os

from vertracloud import VertraClient

client = VertraClient(api_key=os.environ["VERTRA_API_KEY"])

me = client.account.get()
print(f"Hi {me['name']}! Plan: {me['plan']['name']}")

for app in me["applications"]:
    print(app["id"], app["name"], app["status"])

Documentation

Every method has a docstring with its HTTP route and the API key scope it needs.

Usage

Client options

client = VertraClient(
    api_key=os.environ["VERTRA_API_KEY"],
    timeout=10,  # seconds, default 30 per call
    # base_url, user_agent and a custom transport are also accepted
)

Per-call options

Methods on apps and databases take a keyword-only workspace_id; downloads, uploads and streams also take timeout:

# Act on a resource that belongs to a workspace
app = client.apps.get(app_id, workspace_id=workspace_id)

# Give one slow call more time
zip_bytes = client.apps.download(app_id, timeout=300)

Nested resources are attributes: client.apps.deploys, client.apps.releases, client.apps.envs, client.workspaces.members, client.billing.orders, …

Apps

app = client.apps.get(app_id)

client.apps.restart(app_id)  # normal restart
client.apps.restart(app_id, {"reinstall_dependencies": True})

metrics = client.apps.metrics(app_id, range="24h")
logs = client.apps.logs(app_id)

Releases and rollback

page = client.apps.releases.list(app_id, limit=20)  # newest first, max 50 per page
release_id = page["data"][1]["id"]

log = client.apps.releases.log(app_id, release_id)  # log["content"] is None when absent or expired

# Preview what restoring the saved environment variables would change.
# The preview returns variable names only, never values.
preview = client.apps.releases.preview_rollback(app_id, release_id)
for change in preview["environment_changes"]:
    print(change["key"], change["change"])  # added | modified | removed

# Restores the release's code and restarts the app. Variables are kept unless you ask for them.
new_release = client.apps.releases.rollback(app_id, release_id, {"restore_environment": True})

rollback needs apps:write; with restore_environment the key also needs apps:envs, as does the preview. Deploy behavior is set through update_config:

client.apps.update_config(
    app_id, {"deploy": {"zero_downtime": "auto", "auto_rollback": True, "health_check_path": "/health"}}
)
client.apps.update_config(app_id, {"deploy": {"health_check_path": None}})  # clears the path

client.apps.files.upload(..., message="...") sets the message shown in the release history.

Uploading and downloading

Uploads take bytes; downloads return bytes.

with open("app.zip", "rb") as f:
    app = client.apps.create({"name": "my-app", "memory": 512}, file=f.read())

with open("backup.zip", "wb") as f:
    f.write(client.apps.download(app_id))

client.snapshots.download works the same way.

Realtime logs (SSE)

stream = client.apps.realtime(app_id)
try:
    for event in stream:
        print(event.event, event.data)
finally:
    stream.close()

Stop the stream with break or stream.close(). Pass since= to resume. There is no automatic reconnection.

Errors

Every non-2xx response raises a VertraAPIError carrying the HTTP status, the API code (e.g. APP_NOT_FOUND) and details; str(err) includes the message. The API key is never part of the error, even when it is printed:

from vertracloud import NotFoundError, RateLimitError, VertraAPIError

try:
    client.apps.get(app_id)
except NotFoundError:
    ...  # 404
except RateLimitError as err:
    print("retry after", err.retry_after, "s")
except VertraAPIError as err:
    print(err.status, err.code, err)

Other subclasses: AuthenticationError (401), ScopeDeniedError (403 — including a missing key scope) and ValidationError (400/422). The error codes are listed in the API reference.

Testing your code

Pass your own vertracloud.Transport to the client to answer requests without touching the network:

client = VertraClient(api_key="test", transport=my_fake_transport)

Coverage

Domain Resource Routes
Apps client.apps (+ .deploys, .releases, .network, .envs, .files) 40
Databases client.databases (+ .credentials) 13
Snapshots client.snapshots 5
Account client.account (+ .sessions, .folders, .favorites) 10
Workspaces client.workspaces (+ .members, .roles, .invites, .action_requests, .apps, .databases, .folders, .favorites) 30
Billing client.billing (+ .orders) 7

Dashboard-only features (activity log, notifications, API key management, the database Data tab, plan downgrade, creating workspace invites, card payments, saved cards, automatic renewal, coupon preview, receipts and approving action requests) are not part of the public API. See what an API key cannot do.

Versioning

The SDK follows semantic versioning. Until 1.0.0, minor releases may contain breaking changes; they are always called out in the changelog.

Contributing

Issues and pull requests are welcome. Before sending a change, run:

pip install -e ".[dev]"
ruff check . && ruff format --check . && mypy src && python -m pytest -q

License

MIT

Metadata

Release files for vertracloud-api 0.1.5

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

Source distribution (sdist)

Source distribution for vertracloud-api 0.1.5
File Size Uploaded
vertracloud_api-0.1.5.tar.gz 65.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vertracloud-api 0.1.5
File Interpreter ABI Platform
vertracloud_api-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 91.9 kB

Release files / vertracloud_api-0.1.5.tar.gz

Download URL vertracloud_api-0.1.5.tar.gz
Size 65.7 kB
Tags Source
SHA-256 checksum
How to use checksums
87480e4366d92557ed3b693e6026abae4c7914b0cce15b007d882228726b428b
BLAKE2b-256 checksum
How to use checksums
c333cf366001ed1c6d6168cdb1fe93d77fc88fe0cb7d649d6a341767c6dc4cf8
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 Oct 12, 2026.

Transparency log

Release files / vertracloud_api-0.1.5-py3-none-any.whl

Download URL vertracloud_api-0.1.5-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19babca88746801184d6c3768b87e405159d7917c3133b1dc9db2b330525fd5d
BLAKE2b-256 checksum
How to use checksums
1e75d3e25d385961fe44b4361b60ab44561e02f47b7a06ca54e90d6487af20dc
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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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