loopsandbox
Python SDK for LoopScale code sandboxes: start an isolated sandbox, run commands in it, read and write its files.
The Sandbox class has the shape of the one in the e2b SDK, so a script written for e2b runs after a change of import and of API key.
Install
pip install loopsandbox
Python 3.9 or newer. The package has no dependency.
Use
Create an API key with the sandbox:execute scope under API Tokens in the LoopScale console, and set it in the environment:
export LOOPSCALE_API_KEY=...
from loopsandbox import Sandbox
sandbox = Sandbox.create("python")
try:
sandbox.files.write("hello.py", 'print("hello from the sandbox")')
result = sandbox.commands.run("python hello.py")
print(result.stdout)
finally:
sandbox.kill()
Sandbox.create takes the name of a template (python, node, base, claude, codex and others) or an image of the catalog.
Settings
| Variable | Meaning |
|---|---|
LOOPSCALE_API_KEY |
The API key. The api_key argument overrides it. |
LOOPSCALE_DOMAIN |
Host of the console, app.getloopscale.com by default. The domain argument overrides it. |
LOOPSCALE_API_URL |
Full URL of the API, for a self-hosted deployment. It must use HTTPS unless the host is this machine. |
What differs from e2b
- Files live under
/workspace. Insandbox.filesand in thecwdof a command,/home/userstands for/workspace. - A command line runs through
/bin/sh -c. - The network is open by default;
allow_outanddeny_outrestrict it, andsandbox.network_denials()lists the refused connections. - Not available:
get_host,upload_url,download_url,get_mcp_url,get_mcp_token,git,files.watch_dir,Sandbox.forkand the snapshot methods.
The repository README has the full list of methods and differences.
License
Apache-2.0
Metadata
Release files for loopsandbox 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| loopsandbox-0.1.0.tar.gz | 25.7 kB | With provenance | Details for loopsandbox-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| loopsandbox-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for loopsandbox-0.1.0-py3-none-any.whl |
Total release size: 54.7 kB
Release files / loopsandbox-0.1.0.tar.gz
| Download URL | loopsandbox-0.1.0.tar.gz |
|---|---|
| Size | 25.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d41526d4cf82d9bc51b6dbae15742cfbbcd8c3fe0b1653632169d5c1186b13d
|
|
BLAKE2b-256 checksum How to use checksums |
abbff9ce8f4f5c138382df1070644a166011bb3860e9c927e0af8bf6212a958d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / loopsandbox-0.1.0-py3-none-any.whl
| Download URL | loopsandbox-0.1.0-py3-none-any.whl |
|---|---|
| Size | 29.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
befa0480a34343a3ff461d1ef3d51ae8e0de80cd10d3a6dfefc084b2d16b9da1
|
|
BLAKE2b-256 checksum How to use checksums |
5f9ede2417eb955903b8466086fea305feb4d1a7f4483b5550e962b522d1f4d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for loopsandbox 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for loopsandbox-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.