e2b-dev / E2B

Secure open source cloud runtime for AI apps & AI agents
https://e2b.dev/docs
Apache License 2.0
6.93k stars 453 forks source link

Consider implementing Python `pathlib.Path` interface for e2b filesystem #465

Open brendanator opened 2 hours ago

brendanator commented 2 hours ago

Is your feature request related to a problem? Please describe. It'd be great if I could use python standard library to handle files in the sandbox

Describe the solution you'd like

with Sandbox() as sbx:
  # access the root directory
  root_path = sbx.Files.root_path()
  for path in root_path.iterdir():
      print(path)

  # access the user directory
  user_path = sbx.Files.user_path()
  example_path = user_path / "example.txt"
  example_path.write_text("hello sandbox")

Additional context Additional awesomeness would be achieved if I could use things like shutil.copytree for bulk file transfers to and from the sandbox

linear[bot] commented 2 hours ago

E2B-1122 Consider implementing Python `pathlib.Path` interface for e2b filesystem