Skip to content

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

@brendanator

Description

@brendanator

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions