Jupyter is the new Excel (but not for your boss)
By: Dan Lester
Tags: Jupyter Notebook, Excel, Data Science, Jupyter

When you can’t escape from Jupyter

While the export options above just about allow you to obtain the crux of your notebook in a standalone file format, sometimes (especially where widgets feature heavily in your notebook) you need to find a way to stick with your existing Jupyter format.

But you need to find a way to share it with your non-developers such that it:

makes sense to them

is easy to access

is secure so sensitive data cannot be seen outside your organisation

is safe so that non-developers can’t break anything or destroy any data

The rest of this article uncovers some possible approaches to this.

Jupyter’s own projects

The Project Jupyter organisation has some auxiliary projects that might be considered if you need to share notebooks frequently enough that it’s worth investing in some infrastructure.

The Two Hubs

JupyterHub is a way to centralise the creation of Jupyter workspaces on shared resources, so at least other users will not need to run their own Jupyter servers. Unless you have a small organisation that can run JupyterHub on an internal network, you will need to consider how to add authentication for the appropriate users. There are some suggestions here as to how you might share notebooks within different users’ workspaces.

Logo on the JupyterHub homepage

BinderHub really extends JupyterHub by allowing a user to launch a Jupyter workspace based on a specific computing environment (Python packages etc) which is defined within a git repository along with the data files and notebooks relevant to the project. The user can launch the workspace by accessing a single URL directly. This allows a much more formalised and easy-to-access showcase for your work. To see an example on the public instance of BinderHub known as mybinder.org, check out the ‘Launch Binder’ link on the Readme page of my nb2xls repo on GitHub.

In practice, both of these projects aren’t suitable for our task out-of-the-box— the management team don’t want to have to shift-enter their way through a notebook! And storing work in a git repo or workspace, such that it makes sense to a non-developer, is a lot of administrative overhead.

nbviewer

nbviewer is a much more suitable and lightweight service for easy hosting of notebooks through a single URL. Think of it as a hosted web-page version of the HTML export option discussed above: Javascript can work, but there is no live kernel behind it so really the user can only see the results of your work as output in your last notebook run.

As with Binder, there is a free hosted version of nbviewer for you to try out. Typically, you provide the URL to a notebook on GitHub, but it can also work with a Dropbox link. For example, ‘Copy Dropbox Link’ on an ipynb file in Dropbox, then paste the URL into the box on https://nbviewer.jupyter.org/. You can share the resulting viewer page’s URL with your colleagues, but of course note that this is not secure.

nbviewer.jupyter.org homepage

Sharing a URL is more likely to feel natural than emailing an HTML file to your management team, but really you’re not going to get much from nbviewer that you couldn’t achieve with the HTML export.

So none of the major Project Jupyter initiatives appear to help us much so far…

There it is!

A recent development from Project Jupyter might be just what we’re looking for: voilà allows you to host a notebook with a live kernel without any shift-entering required. By default, code cells are hidden. And by default execute requests from the front-end are disallowed, so the user can’t break anything even if they tried!

The Jupyter blog post announcing voilà does a great job of describing the problem they’re trying to solve (which is exactly the one we’re discussing!) and explains some of the features.

voilà logo

This could become a fantastic way to share your notebooks in the situations we’re discussing, but it still needs a lot of work. At the time of writing, you can only share a single-user link to the notebook-application, and multiple users could clash if their independent actions manage to confuse the flow of data in your notebook.

Plans are already in place to integrate voilà with JupyterHub (mentioned above) which should allow multiuser access to your voilà-hosted notebooks. Of course you would still need to be sure the voilà server is running whenever your colleagues choose to look at your notebook, so this isn’t something you would typically keep running on your local machine.

Looking Further Afield

Kyso is a third-party service allowing you to ‘blog your data science’. There are public notebooks (as well as articles, links, datasets, and charts) listed on their homepage that should give you some idea how notebooks can be shared On the paid plan you can restrict collaboration to within your team. Code input cells are hidden by default!

It should be possible to include live Jupyter widgets although right now I run into problems due to the fact that JupyterLab isn’t fully stable and many Jupyter widgets aren’t yet adapted for JupyterLab. Kyso seems to be fixed on JupyterLab 0.35 at the moment.

Please reach out to their sales team for more details on functionality if you think a third-party service like this could work for you.

Kyso homepage showing some public notebooks

Another service, Saturn Cloud is a full cloud hosting environment for your data science, as an alternative to Google Cloud or AWS etc, with ‘publish’ functionality built in. While your colleagues could easily launch your notebooks, it doesn’t appear that fully-private publication is possible.

I’m sure there are others. Please let us know in the comments if you’ve used a third-party service to solve this problem.