Python SDK
Status: planned, not published yet. The package name will be kabin on PyPI. Until then use the HTTP examples in the quickstart; they only need the Python standard library.
Install and configure
python -m pip install kabin # not available yet
The client reads KABIN_API_KEY and KABIN_API_URL (default https://api.kabin.dev). Python 3.9 or newer.
Conventions
- Synchronous client; method names are snake_case, request fields are sent in camelCase as the API expects.
- Every response is unwrapped from the
{ok, type, ...}envelope; a failed call raises an error object withstatus,code,message,request_idanddetails. See errors. create_sandboxandfork_sandboxtake anidempotency_key.delete_sandboxsends the confirm header for you.
Methods
| Method | Route |
|---|---|
create_sandbox, list_sandboxes, get_sandbox, update_sandbox | POST/GET /sandboxes, GET/PATCH /sandboxes/{id} |
stop_sandbox, resume_sandbox, fork_sandbox, delete_sandbox | /stop, /resume, /fork, DELETE /sandboxes/{id} |
command, command_stream, command_status, kill_command | /commands |
read_file, write_file, delete_file, list_files | /files, /files/list |
inject_ssh_key, get_usage | /sshkey, /usage |
save_snapshot, list_saved_snapshots, get_saved_snapshot, delete_saved_snapshot | /saved-snapshots |
me, limits | /me, /limits |
Helpers
wait_until_ready, exec_command (synchronous, retries retryable 502s), stream_command (iterates the NDJSON frames), run_command (detached command with offset-based polling), read_text / write_text and stop_and_remove.
The constructor and import names are final when the package is published; the package README is then authoritative.