Open
Description
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:
- 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:
# ...
- 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')
- 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
Labels
No labels