Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

BoxFab Code Interpreter (Python)

Run AI-generated code in isolated BoxFab sandboxes, Jupyter-style: Python, JavaScript, TypeScript, R, Java and Bash, with results such as text, tables and charts returned as data.

Getting started

1. Install the SDK

pip install boxfab-code-interpreter

2. Get a BoxFab API key

Get a key from the BoxFab dashboard and set it as BOXFAB_API_KEY. The SDK reads only BOXFAB_* variables.

3. Execute code with code interpreter inside Sandbox

from boxfab_code_interpreter import Sandbox

with Sandbox.create() as sandbox:
    sandbox.run_code("x = 1")
    execution = sandbox.run_code("x+=1; x")
    print(execution.text)  # outputs 2

4. Bind the configuration to a client

The top-level Sandbox and AsyncSandbox exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create a BoxFab client and use the resource classes it exposes:

from boxfab_code_interpreter import BoxFab

client = BoxFab(api_key="e2b_***", domain="us-west.boxfab.dev")

with client.Sandbox.create() as sandbox:
    execution = sandbox.run_code("x = 1; x += 1; x")

# The async variant is exposed as well.
async_sandbox = await client.AsyncSandbox.create()

# The core resources are bound to the client's configuration as well.
volume = client.Volume.create("my-volume")
exists = client.Template.exists("my-template")
secret = client.Secret.create("openai-api-key", "sk-***")

# The classes can be assigned and used like the top-level ones.
Sandbox = client.Sandbox
paginator = Sandbox.list()

Per-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.

Under the hood

Sandboxes are created from the code-interpreter-v1 template, which BoxFab provides to every team: a Jupyter server with common data-science packages. BoxFab sandboxes are Firecracker microVMs, run on the open-source E2B sandbox infrastructure. This package is derived from the open-source E2B Code Interpreter SDK; UPSTREAM.md lists every change.

Using the E2B Code Interpreter SDKs. BoxFab serves the same API and provides the code-interpreter-v1 template, so the E2B Code Interpreter SDKs work with it as well. Set both variables, the domain first:

export E2B_DOMAIN=us-west.boxfab.dev
export E2B_API_KEY="<your BoxFab API key>"

Without E2B_DOMAIN, the E2B SDKs send requests, including the key, to E2B's own service.

Tested against BoxFab with e2b-code-interpreter 2.11.6 (Python) and @e2b/code-interpreter 2.9.0 (JavaScript).

License

MIT, as the E2B Code Interpreter SDK it is derived from; see LICENSE.

BoxFab is a product of ContextFab, Inc.

Metadata

Release files for boxfab-code-interpreter 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boxfab-code-interpreter 0.1.0a2
File Size Uploaded Provenance Actions
boxfab_code_interpreter-0.1.0a2.tar.gz 13.2 kB With provenance Details for boxfab_code_interpreter-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for boxfab-code-interpreter 0.1.0a2
File Interpreter ABI Platform Actions
boxfab_code_interpreter-0.1.0a2-py3-none-any.whl Python 3 none any Details for boxfab_code_interpreter-0.1.0a2-py3-none-any.whl

Total release size: 31.6 kB

Release files / boxfab_code_interpreter-0.1.0a2.tar.gz

Download URL boxfab_code_interpreter-0.1.0a2.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d5d4eaa61df75688084e7277d1bf70989387b37a45f146eb16b9b757ca9adc3d
BLAKE2b-256 checksum
How to use checksums
6b2e1c6d1484e5c9d2151f749ce3cc1413e05504a5fe325fcc343eb83d53bd42
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 16, 2026.

Transparency log

Release files / boxfab_code_interpreter-0.1.0a2-py3-none-any.whl

Download URL boxfab_code_interpreter-0.1.0a2-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abd8bf34a8fa4aac16ba0bc0ff443fe27095ac828a1215b92d54e6b9c9bceea6
BLAKE2b-256 checksum
How to use checksums
eab48d9a7b993bd7d245024a23b1221563c0eaf168699ac18cabedee53642c85
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 16, 2026.

Transparency log

Security for boxfab-code-interpreter 0.1.0a2

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.

Select from 2 files

Attestation for boxfab_code_interpreter-0.1.0a2.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 16, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page