Skip to main content

warmbox for Python

A synchronous, typed client for Python 3.11+. It uses the standard library and talks to the host daemon, with an API token from Settings → API tokens. Use the daemon's HTTPS address for a remote host, or its loopback address through an SSH tunnel. Certificate verification stays enabled.

Install from PyPI (or from a checkout with python -m pip install ./sdk/python):

python -m pip install warmbox

For agents

Set WARMBOX_TOKEN to your API token and WARMBOX_WORKSPACE_ID to your workspace ID. WARMBOX_URL defaults to http://127.0.0.1:7070 in this example.

import os
from warmbox import WarmboxClient

client = WarmboxClient(os.getenv("WARMBOX_URL", "http://127.0.0.1:7070"),
                       token=os.environ["WARMBOX_TOKEN"],
                       workspace_id=os.environ["WARMBOX_WORKSPACE_ID"])
desktop = client.create_desktop({"image": "headless"})
try:
    result = client.exec(desktop["id"], {"cmd": "uname -a"})
    print(result["stdout"])
finally:
    client.destroy_desktop(desktop["id"])

Commands, files and streams

Methods use the daemon's JSON field names. exec accepts cmd or argv, plus cwd, env, stdin and timeout_ms. A command's nonzero exit code is returned in the result; HTTP failures raise APIError with status and body.

from contextlib import closing

client.write_file(desktop_id, "/home/input.bin", b"\x00\xff")
data = client.read_file(desktop_id, "/home/input.bin")
run = client.start_run(desktop_id, {"cmd": "uname -a"})
with closing(client.stream_run(desktop_id, run["id"])) as events:
    for event in events:
        if "out" in event:
            print(event["out"], end="", flush=True)
        else:
            print("exit:", event["exit"].get("exit"))

stream_run and stream_session yield output events followed by an exit event. They accept from_offset to resume at a byte offset; reconnecting is explicit. A connection that ends without an exit event raises ConnectionError. Use closing when you may stop reading early. Closing a stream leaves the command running; kill_run or destroy_session stops it.

The client also provides list_desktops, get_desktop, pause_desktop, resume_desktop, list_files, delete_file, move_file, list_runs, get_run(tail=...), write_stdin, create_session, session_input and destroy_session. Sessions keep shell state between inputs; session_input sends a shell line, while write_stdin sends raw bytes.

timeout defaults to 120 seconds for socket operations, including idle stream reads. Use timeout=None for an unbounded wait. It is separate from the guest's timeout_ms. Requests are not retried and redirects are rejected, so a desktop creation is never replayed and credentials are not forwarded to another URL.

Development

cd sdk/python
python -m unittest discover -s tests -v
python -m pip install build mypy
python -m mypy --strict warmbox
python -m build

The tests use a local HTTP fixture; no VM is needed. The package version matches the current warmbox release (0.4.0); update it alongside the next release.

Metadata

Release files for warmbox 0.5.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 warmbox 0.5.5
File Size Uploaded Provenance Actions
warmbox-0.5.5.tar.gz 13.8 kB With provenance Details for warmbox-0.5.5.tar.gz

Built distribution (wheel)

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

Total release size: 24.4 kB

Release files / warmbox-0.5.5.tar.gz

Download URL warmbox-0.5.5.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c0e7d657a570c7c271e2f03a0aa1b05f4e7f6d06b4414be3f2eb645f74834d98
BLAKE2b-256 checksum
How to use checksums
8069cb2c0cfca9455cb5d7b69715ba0b7a583e84e59c9b5a2d82fc3e1c8678a7
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 11, 2026.

Transparency log

Release files / warmbox-0.5.5-py3-none-any.whl

Download URL warmbox-0.5.5-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6945a6cc07244685cb23e19727921759d585121961de0daa7c8648769ba01820
BLAKE2b-256 checksum
How to use checksums
107c925e30ea285f9b5b43859b92735323bd5c219a8379074aaf73387a46f167
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 11, 2026.

Transparency log

Security for warmbox 0.5.5

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for warmbox-0.5.5.tar.gz

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 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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