8000 Convenience methods or something like Python's "open" for accessing Girder files · Issue #24 · girder/girder_jupyter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Convenience methods or something like Python's "open" for accessing Girder files #24
Open
@jeffbaumes

Description

@jeffbaumes

Assuming we have #23, it would be great to add a few convenience methods which also know the current notebook's path inside Girder in order to read/write Girder files. Some options:

  1. A girder_jupyter.open function would return something duck typed to work identically to python files. The path would be relative to where the notebook is saved in Girder.
from girder_jupyter import open

with open('relative/path/to/file.csv') as f:
    # ...

with open('relative/path/to/new_file.csv', 'w') as f:
    # ...
  1. Because the prior idea may be tricky/impossible, some basic I/O operations like this could be helpful:
content = girder_jupyter.read('relative/path/to/file.csv')

# ...

girder_jupyter.save(new_content, 'relative/path/to/new_file.csv')
  1. We go a whole other route and mount the filesystem locally with Girder's FUSE support, but this is currently read-only and may be somewhat (very?) involved to make it a writable filesystem. In this case, everything would work, including 3rd party use of Python's standard open. In this case, it would seem that the contents manager is not even needed. Thoughts @manthey?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0