Run code in isolated, ephemeral cloud sandboxes (QuickTane) — one API call.
pip install quicktanefrom quicktane import QuickTane
qt = QuickTane("sk_live_...") # or set QUICKTANE_API_KEY
run = qt.run_and_wait("print('hello from the sandbox')", language="python")
print(run.status) # "completed"
print(run.output) # "hello from the sandbox\n"
print(run.exit_code) # 0Supported languages: python, node.
Instead of waiting, queue the run and let a webhook notify you when it finishes:
run = qt.run("print(2 + 2)", language="python")
print(run.run_id, run.status) # 42 running
# later, or fetch on demand:
run = qt.get_run(42)Register a webhook endpoint in your dashboard, then verify deliveries:
from quicktane import verify_signature
# in your webhook handler — use the RAW request body
if not verify_signature(raw_body, request.headers["X-QuickTane-Signature"], signing_secret):
abort(400)Run many commands in one live sandbox — file and process state persist between calls:
sbx = qt.create_sandbox("python") # waits until ready
sbx.files.write("app.py", "print('hello from a session')")
result = sbx.exec(command="python app.py")
print(result.stdout, result.ok) # "hello from a session\n" True
# state persists across execs:
sbx.exec(command="pip install requests")
sbx.exec("import requests; print(requests.__version__)")
sbx.kill()
# or auto-kill with a context manager:
with qt.create_sandbox("node") as sbx:
print(sbx.exec("console.log(2 + 2)").stdout)QuickTane(api_key, base_url=..., timeout=...) |
client; api_key falls back to QUICKTANE_API_KEY |
QUICKTANE_BASE_URL |
override the API base (e.g. http://localhost:8000 for local dev) |
All errors subclass quicktane.QuickTaneError:
AuthenticationError (401/403), NotFoundError (404), ValidationError (422),
RateLimitError (429), APIError (other). Each carries .status_code and .body.
pip install -e '.[dev]'
pytestMIT licensed.