vmon Python SDK
Thin Python client SDK for the Rust vmon API. The Rust vmon binary owns the CLI, vmon serve gRPC/HTTP/WebSocket server, and VMM runtime; this package only provides Python objects for talking to that API.
Install
For development from the repository root:
uv sync --project sdk/py --python 3.14
The vmon distribution supports Python 3.14 and newer. The SDK expects a running Rust daemon/server. By default it talks to the local Unix socket at $VMON_HOME/vmond.sock (or ~/.vmon/vmond.sock). Named remote contexts are stored under $VMON_HOME/contexts.json, and bearer tokens can come from VMON_API_TOKEN or $VMON_HOME/credentials/<context>.token.
Local release package
From the repository root, build and validate the wheel and source distribution:
./scripts/package-python-sdk.sh
The script cleans sdk/py/dist/, builds vmon with Python 3.14, checks both distributions' metadata, installs the wheel and its dependencies into an isolated Python 3.14 environment, and verifies that import vmon resolves from that environment's installed wheel with a package version matching the distribution metadata. It does not publish or read upload credentials.
The publishable wheel and source distribution remain in sdk/py/dist/. The script also creates the deterministic release bundle and checksum consumed by the release workflow:
dist/vmon-python-sdk-<version>.tar.gz
dist/vmon-python-sdk-<version>.tar.gz.sha256
To inspect or install the locally built wheel:
uvx --python 3.14 twine check sdk/py/dist/*
uv pip install --python 3.14 sdk/py/dist/vmon-*.whl
Publishing to a package index is outside this local packaging workflow. The script does not invoke an upload command or read upload credentials.
Quick start
import vmon
with vmon.connect("vmon://node-a,node-b") as client:
assert client.health().ok is True
work = client.volumes.create("work")
with client.sandboxes.create(
image="alpine:latest",
env={"APP_ENV": "dev"},
secrets=[vmon.Secret.from_env("API_TOKEN")],
volumes={"/data": work},
) as sandbox:
captured = sandbox.run("sh", "-lc", "printf captured")
assert captured.returncode == 0
assert captured.stdout == b"captured"
process = sandbox.exec("sh", "-lc", "echo hello > /data/out && cat /data/out")
assert process.wait(timeout=30).code == 0
template = sandbox.snapshot_filesystem("alpine-ready")
restored = client.sandboxes.create(template=template)
restored.terminate()
Public surface
connect()parses local, HTTP(S), multi-host mesh, Unix-socket, and named-context DSNs and returns aClient.MeshDriverdiscovers peer advertise URLs lazily, fails over only on transport errors, and keeps sandbox calls pinned to the node that owns them.Clientexposessandboxes,snapshots,volumes,pools, andmeshresource namespaces. Health, server info, and event calls return the exportedHealth,ServerInfo, andEventRecordmodels; Prometheus metrics remain text.Sandboxis a bound resource.run()captures a command;exec()opens a streamingProcess;filesandportsexpose bound filesystem and proxy operations. Runtime metrics, network policy, and tunnels returnSandboxMetrics,SandboxNetworkPolicy, andTunnelSet. Lifecycle methods return typedSandboxInfoviews with desired/observed state, transition generation and failure, HA tier, and restart policy;RecoveryPoint.kindisdiskorcheckpoint.Process.wait()returnsExecExit; stdin is available throughprocess.stdin, and stdout/stderr remain closeable byte streams. Console, event, log, and file streams are closeable context managers.VolumeandSecretare validated request values. Server-side volume lifecycle lives underclient.volumes; secret values stay in memory and are sent only in create and exec requests.APIError,TransportError, andProtocolErrordistinguish server envelopes, failover-eligible I/O failures, and malformed wire data.sandbox.aio,sandbox.files.aio, andsandbox.ports.aioprovide thread-backed async forms of the synchronous object hierarchy.client.function()and@vmon.functionpackage source-available callables into server-native durable functions. Calls are recorded before execution, expose stableFunctionCallIDs, resumable events/results,spawn()and boundedmap()forms, and server-owned retries with at-least-once attempt semantics. Portable values use JSON/CBOR envelopes; explicitly trusted Python serialization supports richer values.@vmon.clsdefines durable actors with@vmon.method/@vmon.enter/@vmon.exitlifecycle hooks, andvmon.is_remote()reports worker-side execution.
Durable lifecycle
pause() retains the live VM. resume() resumes a paused VM or restores the
exact committed checkpoint of a durably suspended sandbox. suspend() releases
the live VM only after the checkpoint and lifecycle state commit; failure leaves
the previous VM authoritative. Recovery history is oldest to newest: disk
points cold-boot and checkpoint points restore VM execution state.
suspended = sandbox.suspend()
assert suspended.desired_state == suspended.observed_state == "suspended"
resumed = sandbox.resume()
point = sandbox.history()[-1]
restored = sandbox.rollback(point.name)
assert resumed.observed_state == restored.observed_state == "running"
Real-VM SDK smoke test
From the repository root, after building the Rust binary and enabling real-VM e2e prerequisites:
VMON_BIN=$PWD/target/debug/vmon VMON_E2E=1 uv run --python 3.14 python sdk/py/e2e.py
Metadata
Release files for vmon 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vmon-0.2.1.tar.gz | 171.1 kB | Without provenance | Details for vmon-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vmon-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for vmon-0.2.1-py3-none-any.whl |
Total release size: 324.5 kB
Release files / vmon-0.2.1.tar.gz
| Download URL | vmon-0.2.1.tar.gz |
|---|---|
| Size | 171.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
773a4ea1d40bcc89e8e9de4d771cb61a8fcdefc10b71c71b2f4d28181a01e285
|
|
BLAKE2b-256 checksum How to use checksums |
bc386f36d1555a95b2a6d29b6885d0c7683654380f0403b20d1d097dd65984e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / vmon-0.2.1-py3-none-any.whl
| Download URL | vmon-0.2.1-py3-none-any.whl |
|---|---|
| Size | 153.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
785876185c52b974afade066b5943cfb810df99230482eff23b108042cec5bce
|
|
BLAKE2b-256 checksum How to use checksums |
c61b264596430282adfaaa2f0f7c2a9860681d6530989d8b80a0fec2f87fb781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for vmon 0.2.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.