You have a brilliant Jupyter notebook you’ve been working on.
If only you could share it with the world! Here’s are some options for getting your great notebook online.
- If you just want to show a notebook to people without them running the code, nbviewer does the job by showing the cells and their output and supplying a link where your notebook will always live. If your visitor likes what they see, they can immediately launch a functioning version via a Binder link, or download the .ipynb file. Here’s a simple example of what you see.
- If your notebook is in a github repo, you can to go https://mybinder.org/, supply the repository url and it will serve up all the repo files, with the notebook cells showing output. If the notebook needs modules that aren’t builtins, you can add a requirements.txt file to the repo, so that Binder knows they’re needed when it builds your online notebook environment.
- The Voilà package “turns Jupyter notebooks into standalone web applications” or if you prefer, it puts only the cell output on the webpage. Where it gets really useful is by involving widgets from ipywidget to allow user interaction. Here are some examples running as Heroku apps:
- an OSINT quiz built using only text, user input and images
- some random notes on Welsh Senedd elections, with (unlabelled) maps, graphs and drop down filters
- jupyter{book} lets you build a complete book using notebook elements. Here’s an example of a jupyter book with four chapters and here’s a gallery of books.
A github repo with Github Pages enabled can run as a webpage using a package called nbinteract but I’ve found it has trouble loading widgets, as seen in some of the tutorial pages.
Of course, Jupyter notebooks are not the only option: Kaggle, Google Colab, Iodide, Azure and many more. There’s an episode of the podcast Talk Python To Me which features the authors of a paper that reviewed 60 (!) of them.