Kabin

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 with status, code, message, request_id and details. See errors.
  • create_sandbox and fork_sandbox take an idempotency_key. delete_sandbox sends the confirm header for you.

Methods

Client methods and the routes they call
MethodRoute
create_sandbox, list_sandboxes, get_sandbox, update_sandboxPOST/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.