Skip to main content

E2B Code Interpreter - Stateful code execution

Project description

e2b logo

Last 1 month downloads for the Python SDK

What is E2B?

E2B is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.

Run your first Sandbox

1. Install SDK

pip install e2b-code-interpreter

2. Get your E2B API key

  1. Sign up to E2B here.
  2. Get your API key here.
  3. Set environment variable with your API key.
E2B_API_KEY=e2b_***

3. Execute code with code interpreter inside Sandbox

from e2b_code_interpreter import Sandbox

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

4. Check docs

Visit E2B documentation.

5. E2B cookbook

Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

e2b_code_interpreter-1.0.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

e2b_code_interpreter-1.0.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file e2b_code_interpreter-1.0.1.tar.gz.

File metadata

  • Download URL: e2b_code_interpreter-1.0.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.8.18 Linux/6.5.0-1025-azure

File hashes

Hashes for e2b_code_interpreter-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b0c061e41315d21514affe78f80052be335b687204e669dd7ca852b59eeaaea2
MD5 482793ded522fa9184fbe1f33234da9e
BLAKE2b-256 9a6767441008c3a299ab2d5185b96ba054aa888454e31ce3c2c08c2ef368b4b0

See more details on using hashes here.

File details

Details for the file e2b_code_interpreter-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for e2b_code_interpreter-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e27c40174ba7daac4942388611a73e1ac58300227f0ba6c0555ee54507d4944c
MD5 9ae0bef0d0215a4e12e03396597ed204
BLAKE2b-256 91f14950f1b68be3748add48240efc83a1514c099e55c340bf27c332d0134f1e

See more details on using hashes here.

Supported by

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