Async Python client for Litterbox.
Project description
litterbox-python-sdk
Async Python client for the Litterbox host API.
The SDK provisions sandbox VMs, reads host state, deletes hosts, and returns the SSH connection details a caller needs. It speaks HTTP only: SSH sessions, file transfer, command execution, and retry orchestration belong in the caller.
Install
pip install litterbox-python-sdk
uv add litterbox-python-sdk
Usage
from litterbox_sdk import SandboxAPI
sandbox = SandboxAPI(
base_url="https://sandbox.internal.ts.net",
token="...",
timeout=30.0,
)
try:
host = await sandbox.create_host(
image="ghcr.io/litterbox/sandbox:abc123",
env={"FOO": "bar"},
idempotency_key="agent-run-42",
)
# Use host.ssh_host, host.ssh_port, and host.known_hosts with
# asyncssh or another SSH client.
finally:
await sandbox.delete_host(host.id)
await sandbox.aclose()
SandboxAPI.from_env(prefix="SANDBOX_") reads
SANDBOX_SERVICE_URL, SANDBOX_SERVICE_TOKEN, and optional
SANDBOX_SERVICE_TIMEOUT.
Contract
Public exports live in litterbox_sdk:
SandboxAPISandboxHostSandboxAPIErrorand typed subclasses for auth, not found, conflict, unavailable, and unclassified response errors
Supported host operations:
create_hostget_hostattachlist_hostsdelete_hostaclose
create_host supports the service's optional image, env, expires_at,
and Idempotency-Key inputs.
The SDK does not mint Tailscale auth keys, manage ACLs, establish SSH, provision Linux users, transfer files, or run remote commands.
Development
uv sync
uv run ruff check
uv run ruff format --check
uv run pyright
uv run pytest
Tests use respx to fake the Litterbox HTTP API. They do not need a
real network, VM provider, or Litterbox service.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file litterbox_python_sdk-0.0.2.tar.gz.
File metadata
- Download URL: litterbox_python_sdk-0.0.2.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81d0ec5795e62052de15e01be5deb58b1de8993bf028cb096c22ca72e0e7bb03
|
|
| MD5 |
68ed7ef2dae230652efa0b6d39c61e67
|
|
| BLAKE2b-256 |
2866d8fa5262eb8bbebc1eee6f0b7fad194673b2419bbe0095452039c4624093
|
Provenance
The following attestation bundles were made for litterbox_python_sdk-0.0.2.tar.gz:
Publisher:
release.yml on clawhaven/litterbox-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litterbox_python_sdk-0.0.2.tar.gz -
Subject digest:
81d0ec5795e62052de15e01be5deb58b1de8993bf028cb096c22ca72e0e7bb03 - Sigstore transparency entry: 1673022389
- Sigstore integration time:
-
Permalink:
clawhaven/litterbox-python-sdk@eac611b2d7e8d98968147db464f1b29170d8f9d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/clawhaven
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eac611b2d7e8d98968147db464f1b29170d8f9d7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file litterbox_python_sdk-0.0.2-py3-none-any.whl.
File metadata
- Download URL: litterbox_python_sdk-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f50e0ab70b57b5b4860ad6a002e7b3ea9f8eb36222edd663824febfa3e7f0aaf
|
|
| MD5 |
3f43d29ef7df45332b0c94959864cf49
|
|
| BLAKE2b-256 |
ad2ebcebd87dcebb86ffd153dd4b5c6276f4ac4ba8680ef600d163b2b32902e5
|
Provenance
The following attestation bundles were made for litterbox_python_sdk-0.0.2-py3-none-any.whl:
Publisher:
release.yml on clawhaven/litterbox-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litterbox_python_sdk-0.0.2-py3-none-any.whl -
Subject digest:
f50e0ab70b57b5b4860ad6a002e7b3ea9f8eb36222edd663824febfa3e7f0aaf - Sigstore transparency entry: 1673022398
- Sigstore integration time:
-
Permalink:
clawhaven/litterbox-python-sdk@eac611b2d7e8d98968147db464f1b29170d8f9d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/clawhaven
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eac611b2d7e8d98968147db464f1b29170d8f9d7 -
Trigger Event:
workflow_dispatch
-
Statement type: