dwsandbox-client
A typed Python client for the DonkeyWork Sandbox control plane. The models are generated from the service's OpenAPI spec; the clients wrap them with a base URL and an API key.
pip install dwsandbox-client
Usage
Give it your sandbox access key (dws_...) and it exposes two provisioning methods.
Both a synchronous and an asynchronous client ship in the box.
create — provision and wait
Returns the ready sandbox in one call (blocks ~15s while it provisions), including the absolute MCP URL:
from dwsandbox_client import SandboxClient
with SandboxClient("dws_your_key") as sandbox:
ready = sandbox.create() # template_id=, sandbox_id=, environment=, secret_environment=
print(ready.status, ready.mcp_url)
create_stream — provision with live progress
Yields each provisioning event as it happens:
from dwsandbox_client import SandboxClient, SandboxStatus
with SandboxClient("dws_your_key") as sandbox:
for event in sandbox.create_stream():
print(f"[{event.stage}] {event.message}")
if event.is_terminal:
assert event.status is SandboxStatus.ready
Async
Same surface, await / async for:
import asyncio
from dwsandbox_client import AsyncSandboxClient
async def main():
async with AsyncSandboxClient("dws_your_key") as sandbox:
ready = await sandbox.create()
print(ready.mcp_url)
async for event in sandbox.create_stream():
print(event.stage, event.status)
asyncio.run(main())
The access key may also be sent by your own httpx client — pass http_client= to
either constructor to reuse a configured client (proxies, custom timeouts, etc.). The
base URL defaults to https://sandbox.donkeywork.dev; override with base_url=.
Note on transport.
createandcreate_streamboth go over REST/SSE, which is the transport that works reliably through the public edge. (Native gRPC provisioning exists for in-cluster/LAN callers but the edge does not proxy its long-lived stream.)
Types
dwsandbox_client.models contains the full set of shapes generated from the OpenAPI
spec. The commonly used ones are re-exported at the top level:
CreateSandboxRequest, CreateSandboxResponse, ProvisioningEvent, SandboxStatus.
Fields are snake_case with camelCase wire aliases (e.g. ready.mcp_url ↔ mcpUrl).
Development
Regenerate the models after the API's OpenAPI spec changes:
./scripts/generate.sh # regenerates src/dwsandbox_client/models.py from openapi.json
scripts/generate.sh documents how to refresh openapi.json from the running API.
Releasing (PyPI, via GitHub Actions)
Publishing is automated through .github/workflows/pyclient-publish.yml, which uploads
to PyPI using Trusted Publishing (OIDC, no stored token). Two ways to cut a release:
-
Auto minor bump (normal path): GitHub → Actions → Publish dwsandbox-client → Run workflow. It bumps the minor version in
pyproject.toml, commits it, tagspyclient-v<version>, and publishes — no version to pick by hand. -
Specific version: push the tag yourself (used for the first release):
git tag pyclient-v0.1.0 && git push origin pyclient-v0.1.0
Either way the workflow verifies the tag matches pyproject.toml, builds the sdist +
wheel, and publishes.
One-time PyPI setup (only the project owner can do this): on
pypi.org create the dwsandbox-client project (or a pending
publisher before the first release) and add a Trusted Publisher pointing at this
GitHub repo, workflow pyclient-publish.yml, and environment pypi. No API token or
GitHub secret is needed after that.
Metadata
Release files for dwsandbox-client 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 | Provenance | Actions |
|---|---|---|---|---|
| dwsandbox_client-0.3.0.tar.gz | 21.5 kB | With provenance | Details for dwsandbox_client-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dwsandbox_client-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for dwsandbox_client-0.3.0-py3-none-any.whl |
Total release size: 29.4 kB
Release files / dwsandbox_client-0.3.0.tar.gz
| Download URL | dwsandbox_client-0.3.0.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e809849ba087d9e239b50f78cdcee2fb263df620ace01a1055d550ea5f7e168b
|
|
BLAKE2b-256 checksum How to use checksums |
9c29a18f2af05a84e824629eda94a9a9fdb08292e8a9213c8cac553b7f81dfb5
|
| 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 Aug 20, 2026.
Transparency logRelease files / dwsandbox_client-0.3.0-py3-none-any.whl
| Download URL | dwsandbox_client-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
102abf32a2817be79bac02faadc49c2d3d971ccddd9e6d2252145b6cfbcd6d16
|
|
BLAKE2b-256 checksum How to use checksums |
fcb4528563c44d31ea747c199a16cc3c602653a2c3e1c72ec562df89d7d58faa
|
| 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 Aug 20, 2026.
Transparency logSecurity for dwsandbox-client 0.3.0
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.
Attestation for dwsandbox_client-0.3.0.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 Aug 20, 2026.
Transparency logA 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.