Skip to main content

Python client for the hotcell self-hostable agent sandbox daemon

Project description

hotcell (Python SDK)

Dependency-free Python client for the hotcell self-hostable agent sandbox daemon. Mirrors the TypeScript SDK surface (snake_cased) so the same workflows work from either language.

from hotcell import HotcellClient

client = HotcellClient(endpoint="http://127.0.0.1:4750")  # or $HOTCELL_ENDPOINT
sandbox = client.get_sandbox()                          # create a fresh sandbox

# run a command
result = sandbox.exec("python3 -c 'print(2 + 2)'")
print(result.stdout, result.exit_code)                  # "4\n" 0

# files
sandbox.write_file("/workspace/hi.txt", "hello")
print(sandbox.read_file("/workspace/hi.txt"))           # "hello"

# stateful code interpreter
ctx = sandbox.create_code_context(language="python")
ctx.run_code("x = 21")
print(ctx.run_code("x * 2").results[0].text)            # "42"

# metrics + cost
m = sandbox.metrics()
print(m.cost.total, m.usage.cpu_seconds)

sandbox.destroy()

Standard library only (urllib, json) — no third-party dependencies. Requires Python ≥ 3.9 and a running hotcell daemon.

Surface

HotcellClient: get_sandbox, list, health, info, list_backups, delete_backup.

Sandbox: exec, exec_stream, stop, start, destroy, metrics, write_file, read_file, mkdir, list_files, watch, start_process, list_processes, kill_process, stream_logs, wait_for_port, expose_port, unexpose_port, list_exposed_ports, set_env_vars, get_env_vars, create_session, list_sessions, create_backup, restore_backup, list_backups, create_code_context, list_code_contexts, run_code.

Session: exec, exec_stream, set_env_vars, destroy. CodeContext: run_code, destroy.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hotcell-0.1.17.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hotcell-0.1.17-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file hotcell-0.1.17.tar.gz.

File metadata

  • Download URL: hotcell-0.1.17.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hotcell-0.1.17.tar.gz
Algorithm Hash digest
SHA256 a3d91a0e8c45bfbfd9d3488e9b38b28b7d6a7ce3a75e10ee696a0e438a8c2a3a
MD5 297193f40b3c70698a9701b0bee657d8
BLAKE2b-256 50256e5d118afa8927b0ea958764d357a8c358459dc4a4f9c73c9e3806dc1265

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotcell-0.1.17.tar.gz:

Publisher: release.yml on sinameraji/hotcell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hotcell-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: hotcell-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hotcell-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 72ac0a13179a86dc8c907614ac0c31c624d0a0e92a4047973bb581e6e3187e64
MD5 66ebfe756a9739ac89b277019fb03c12
BLAKE2b-256 ec5440fd55f1675dc22fb1cb3f532b917c12e170b77a331ac76f5b2bc0e473d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotcell-0.1.17-py3-none-any.whl:

Publisher: release.yml on sinameraji/hotcell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page