Notebook: Why Jupyter Notebook does not allow downloading folders?

Created on 29 Nov 2017  路  13Comments  路  Source: jupyter/notebook

Hi, I was wondering if there is a way of downloading folders/data-sets from Jupyter Notebook's home page. I know that if I were running it from my computer this wouldn't make sense, but in my case I'm running it from a server and downloading one file at a time is very time consuming.

Thanks in advance!

Most helpful comment

Lets say you are working in _Dogproject.ipynb_ under directory _dog-project_.

Content of _dog-project_ folder are-
1>Dogproject.ipynb
2>dogimages folder
.
.some other usefull files

Now you want to zip the _dog-project_ folder.

1>Click on the orange Jupyter circle on the top left of the workspace(Dogproject.ipynb).
2>You will see _dog-project_ folder. Now don't go inside it.
3>Open Terminal by Clicking New(look right ) -> Terminal.
4>Zip the dog-project folder with the following command in the terminal: zip -r dog-project.zip dog-project

2018-09-24 25 _li

All 13 comments

There's a new extension for precisely that:

https://github.com/data-8/nbzip

Thanks a lot! But can it download just one folder (or a group of chosen files) instead of all the contents?

I don't know, you'd have to ask them.

This functionality might be integrated into the notebook in the future.

Understood, thanks.

zip -r

on my notebook zip is not working but tar is. so

%%bash
tar -czf archive.tar.gz foldername

Lets say you are working in _Dogproject.ipynb_ under directory _dog-project_.

Content of _dog-project_ folder are-
1>Dogproject.ipynb
2>dogimages folder
.
.some other usefull files

Now you want to zip the _dog-project_ folder.

1>Click on the orange Jupyter circle on the top left of the workspace(Dogproject.ipynb).
2>You will see _dog-project_ folder. Now don't go inside it.
3>Open Terminal by Clicking New(look right ) -> Terminal.
4>Zip the dog-project folder with the following command in the terminal: zip -r dog-project.zip dog-project

2018-09-24 25 _li

Alternatively one can use tar command if zip is not available:

tar czf dog-project.tar.gz dog-project

The Jupyter Notebook has tar available hidden under the hood, so make a new code snippet and tell tar to zip all files and dump to a file, then you can right click download and untar somewhere else.

And if you know IP address of your local machine then, from terminal of jupyter notebook do
scp -r <folder_name_to_download> <local_user@local_ip>:<path_in_local_machine>

thanks guys for the terminal shii
tar -czf archive.tar.gz foldername #this works perfectly

how to download csv file from url use jupyter notebook?

Was this page helpful?
0 / 5 - 0 ratings