Here is and notebook + JLab extension called jupyter-archive: https://github.com/hadim/jupyter-archive
It adds the following features to be able to easily work with data files in remote environments:
- On-the-fly archive (zip, tar.gz, tar.bz2 or tar.xz) and compress folders in JLab.
- Decompress archives as folders directly inside the notebook (JLab file browser).
I don’t know what’s the feeling of the core Jupyter devs but I really would like this extension to be integrated into Jupyter. I think it adds important features to the file browser.
Here is an issue to track the integration: https://github.com/hadim/jupyter-archive/issues/2
Happy to get feedback about the project.
Does this mean that if I upload a
.zip file it is automatically unzipped and available as a folder? Sounds pretty cool.
Do you have a demo that runs on mybinder.org? We have recently been discussing adding a mechanism for people to take home their work via something like nbzip and also how to resume work when they start a new binder (from the same repo). So this looks exciting.
Uncompressing is not automatic after uploading. The command is available in the file context menu. But I guess we could discuss about making it optionally automatic.
I’ll setup a binder soon.
Maybe it is a good idea to not automatically uncompress stuff as you never know what kind of evil stuff is in the zip file.
We should test drive this for a bit and if it works well consider making it an extension that is installed on mybinder.org
The binder is setup: https://beta.mybinder.org/v2/gh/hadim/jupyter-archive/master?urlpath=lab
Would be nice indeed to install it on mybinder.org. That being said I would really like to see that extension integrated into Jupyter.
The code to archive and download is non-blocking in theory but in practice the non blocking code is at the file-level which mean that when you process large file the UI/server will be blocked. I haven’t found a solution to that yet but maybe Jupyter/Tornado experts know how to deal with that. More information here: https://github.com/hadim/jupyter-archive/issues/18
Feeling a bit slow here: how do I zip up the top level directory? I found the menu item in the context menu for sub directories but I can’t work out how to zip up “everything”.
We could add a menu entry when clicking elsewhere a file/folder in the file browser to zip the current folder.
@betatim: Version 0.4.3 adds a command to download the current folder.
Here’s a quick GIF of me trying out the Binder link that @hadim showed, this is really cool and I could see it being quite useful for JupyterHub deployments that we have as well.
That is some very fast turn around! For me the file menu is completely white for a while. Seems like clicking on it or near it triggers a refresh and then it shows its contents. Didn’t seem to do that with the “old” version that didn’t have the context menu for “current folder”.
I am on OSX, clicked the binder link above, Firefox 70.0b11 (64-bit). Let me know if you need other details/things I should try to help debug.
Do you plan to add some UI for the notebook as well or just do lab? (I mostly use notebook so “asking for a friend” )
I work on chromium so I didn’t test on Firefox. Will do and see if I can reproduce.
As for the nb old client, sure we should add the UI. Will try to make a PR.
@betatim I cannot reproduce your issue with Firefox 69 on Ubuntu (I don’t have OSX). Could you try on Chrome/Chromium so we’ll know if it’s a browser issue or an OS issue. Could you open a ticket on the extension repo too please?
@choldgraf can I steal your gif and put it on the repo’s README ?
please feel free to do so!