danielfrg / s3contents

Jupyter Notebooks in S3 - Jupyter Contents Manager implementation
Apache License 2.0
248 stars 88 forks source link

How could I get the current path inside the S3 bucket from within the open notebook? #171

Closed djuarezg closed 1 year ago

djuarezg commented 1 year ago

So, I have a notebook open in Jupyter which is stored in S3. This one is opened thanks to s3contents.

On the open tab I see that the path correctly reports the dir path on the file browser, but the notebook is unaware of it.

How can I retrieve the "virtual" path?

image image

djuarezg commented 1 year ago
#! pip install ipynbname

import ipynbname
nb_fname = ipynbname.name()
nb_path = ipynbname.path()
GomesNayagam commented 8 months ago

this is not working when i use s3contentmanager,

basically i am looking for this command to work or some alternative opiton:

source: s3 destination: localstorage

!cp 'california_cities.csv' 'local_directory/california.csv'


FileNotFoundError Traceback (most recent call last)

in 1 import ipynbname ----> 2 nb_fname = ipynbname.name() /opt/conda/lib/python3.9/site-packages/ipynbname/__init__.py in name() 94 if path: 95 return path.stem ---> 96 raise FileNotFoundError(FILE_ERROR.format('name')) 97 98 FileNotFoundError: Can't identify the notebook name.