Files
e2b-dev--e2b/packages/python-sdk/pyproject.toml
T
Mish Ushakov edeafb1cdd Adds files.getInfo / files.get_info methods to retrieve information about directory/files (#724)
**Changelog**

- Adds `files.getInfo`, `files.get_info` methods to the SDKs.
- Adds tests for the new methods
- Adds documentation for the above.

**Examples**

JavaScript

```js
import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create()

// Create a new file
await sandbox.files.write('test_file.txt', 'Hello, world!')

// Get information about the file
const info = await sandbox.files.getInfo('test_file.txt')

console.log(info)
// {
//   name: 'test_file.txt',
//   type: 'file',
//   path: '/home/user/test_file.txt'
// }
```

Python

```py
from e2b_code_interpreter import Sandbox

sandbox = Sandbox()

# Create a new file
sandbox.files.write('test_file', 'Hello, world!')

# Get information about the file
info = sandbox.files.get_info('test_file')

print(info)
# EntryInfo(name='test_file.txt', type=<FileType.FILE: 'file'>, path='/home/user/test_file.txt')
```

---------

Co-authored-by: Jakub Novak <jakub@e2b.dev>
2025-07-29 03:39:42 -07:00

43 lines
1014 B
TOML

[tool.poetry]
name = "e2b"
version = "1.7.1"
description = "E2B SDK that give agents cloud environments"
authors = ["e2b <hello@e2b.dev>"]
license = "MIT"
readme = "README.md"
homepage = "https://e2b.dev/"
repository = "https://github.com/e2b-dev/e2b/tree/main/packages/python-sdk"
packages = [{ include = "e2b" }, { include = "e2b_connect" }]
[tool.poetry.dependencies]
python = "^3.9"
python-dateutil = ">=2.8.2"
protobuf = ">=5.29.4, <6.0.0"
httpcore = "^1.0.5"
httpx = ">=0.27.0, <1.0.0"
attrs = ">=23.2.0"
packaging = ">=24.1"
typing-extensions = ">=4.1.0"
[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
pytest = "^7.4.0"
pytest-xdist = "^3.3.1"
python-dotenv = "^1.0.0"
pytest-dotenv = "^0.5.2"
pytest-asyncio = "^0.23.7"
pydoc-markdown = "^4.8.2"
ruff = "^0.11.12"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/e2b-dev/e2b/issues"
[tool.ruff]
exclude = [
"e2b/envd/filesystem/filesystem_pb2.py"
]