e2b-code-interpreter 1.3.4rc2__tar.gz → 1.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 FOUNDRYLABS, INC.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,23 +1,22 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.1
2
2
  Name: e2b-code-interpreter
3
- Version: 1.3.4rc2
3
+ Version: 1.5.1
4
4
  Summary: E2B Code Interpreter - Stateful code execution
5
- License: Apache-2.0
5
+ Home-page: https://e2b.dev/
6
+ License: MIT
6
7
  Author: e2b
7
8
  Author-email: hello@e2b.dev
8
9
  Requires-Python: >=3.9,<4.0
9
- Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: License :: OSI Approved :: MIT License
10
11
  Classifier: Programming Language :: Python :: 3
11
12
  Classifier: Programming Language :: Python :: 3.9
12
13
  Classifier: Programming Language :: Python :: 3.10
13
14
  Classifier: Programming Language :: Python :: 3.11
14
15
  Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
16
  Requires-Dist: attrs (>=21.3.0)
17
- Requires-Dist: e2b (==1.3.4rc2)
17
+ Requires-Dist: e2b (>=1.4.0,<2.0.0)
18
18
  Requires-Dist: httpx (>=0.20.0,<1.0.0)
19
19
  Project-URL: Bug Tracker, https://github.com/e2b-dev/code-interpreter/issues
20
- Project-URL: Homepage, https://e2b.dev/
21
20
  Project-URL: Repository, https://github.com/e2b-dev/code-interpreter/tree/main/python
22
21
  Description-Content-Type: text/markdown
23
22
 
@@ -1,29 +1,34 @@
1
1
  import logging
2
- from typing import Dict, Literal, Optional, Union, overload
3
-
4
2
  import httpx
5
- from e2b import AsyncSandbox as BaseAsyncSandbox
6
- from e2b import ConnectionConfig, InvalidArgumentException
3
+
4
+ from typing import Optional, Dict, overload, Union, Literal
5
+ from httpx import AsyncClient
6
+
7
+ from e2b import (
8
+ AsyncSandbox as BaseAsyncSandbox,
9
+ ConnectionConfig,
10
+ InvalidArgumentException,
11
+ )
12
+
7
13
  from e2b_code_interpreter.constants import (
8
14
  DEFAULT_TEMPLATE,
9
- DEFAULT_TIMEOUT,
10
15
  JUPYTER_PORT,
11
- )
12
- from e2b_code_interpreter.exceptions import (
13
- format_execution_timeout_error,
14
- format_request_timeout_error,
16
+ DEFAULT_TIMEOUT,
15
17
  )
16
18
  from e2b_code_interpreter.models import (
17
- Context,
18
19
  Execution,
19
20
  ExecutionError,
20
- OutputHandler,
21
- OutputMessage,
21
+ Context,
22
22
  Result,
23
23
  aextract_exception,
24
24
  parse_output,
25
+ OutputHandler,
26
+ OutputMessage,
27
+ )
28
+ from e2b_code_interpreter.exceptions import (
29
+ format_execution_timeout_error,
30
+ format_request_timeout_error,
25
31
  )
26
- from httpx import AsyncClient
27
32
 
28
33
  logger = logging.getLogger(__name__)
29
34
 
@@ -317,9 +317,16 @@ def serialize_results(results: List[Result]) -> List[Dict[str, str]]:
317
317
  """
318
318
  serialized = []
319
319
  for result in results:
320
- serialized_dict = {key: result[key] for key in result.formats()}
320
+ serialized_dict = {}
321
+ for key in result.formats():
322
+ if key == "chart":
323
+ serialized_dict[key] = result.chart.to_dict()
324
+ else:
325
+ serialized_dict[key] = result[key]
326
+
321
327
  serialized_dict["text"] = result.text
322
328
  serialized.append(serialized_dict)
329
+
323
330
  return serialized
324
331
 
325
332
 
@@ -1,9 +1,9 @@
1
1
  [tool.poetry]
2
2
  name = "e2b-code-interpreter"
3
- version = "1.3.4rc2"
3
+ version = "1.5.1"
4
4
  description = "E2B Code Interpreter - Stateful code execution"
5
5
  authors = ["e2b <hello@e2b.dev>"]
6
- license = "Apache-2.0"
6
+ license = "MIT"
7
7
  readme = "README.md"
8
8
  homepage = "https://e2b.dev/"
9
9
  repository = "https://github.com/e2b-dev/code-interpreter/tree/main/python"
@@ -14,7 +14,7 @@ python = "^3.9"
14
14
 
15
15
  httpx = ">=0.20.0, <1.0.0"
16
16
  attrs = ">=21.3.0"
17
- e2b = "1.3.4rc2"
17
+ e2b = "^1.4.0"
18
18
 
19
19
  [tool.poetry.group.dev.dependencies]
20
20
  pytest = "^7.4.0"