Skip to content
sistemo.io beta
GitHub Docs Quickstart

Python quickstart

From zero to running code in a microVM.

1. Install

pip install sistemo

2. Set your key

export SISTEMO_API_KEY=sk_live_xxxxxxxxxxxxxxxx

3. Run code

from sistemo import Sandbox

with Sandbox() as sb:
    result = sb.run("echo hello from a microVM")
    print(result.stdout)        # "hello from a microVM\n"
    print(result.exit_code)     # 0
    print(result.ok)            # True

4. Run several commands in one sandbox

A sandbox stays alive for the whole with block, so reuse it:

with Sandbox(stack="python") as sb:
    sb.run("pip install requests")
    r = sb.run("python3 -c 'import requests; print(requests.__version__)'")
    print(r.stdout)

5. Pick an image

with Sandbox(stack="node") as sb:        # base | python | node | debian13 | ubuntu24.04
    print(sb.run("node -v").stdout)

See Images for the catalog.

6. Size the sandbox

sb = Sandbox(vcpus=2, memory_mb=2048, rootfs_size_gb=20)
# ... use it ...
sb.close()

Always clean up

Use with Sandbox() as sb: so the VM is destroyed automatically. If you create one manually, call sb.close() in a finally block โ€” a leaked sandbox keeps billing.

Next: Sandbox API ยท Examples