Chapter 10. Sharing and Converting Jupyter Notebooks
Once you have developed your Notebook, you will want to share it with others. There is a typical mechanism available for sharing that we will cover in this chapter—placing your Notebook on an accessible server on the internet.
When you provide a Notebook to another person, they may need the Notebook in a different format, given their system requirements. We will also cover some mechanisms available for providing your Notebook to others in a different format.
In this chapter, we will cover the following topics:
- Sharing Notebooks
- Converting Notebooks
The typical mechanism for sharing Notebooks is to provide your Notebook on a website. A website is running on a server or allocated machine space. The server takes care of all the book-keeping involved in running a website, such as keeping track of multiple users and logging people on and off.
In order for the Notebook to be of use though, the website must have Notebook logic installed. A typical website knows how to deliver content as HTML given some source files. The most basic form is pure HTML, where every page you access on the website corresponds exactly to one HTML file on the web server. Other languages could be used to develop the website (such as Java or PHP), so then the server needs to know how to access the HTML it needs from those source files. In our context, the server needs to know how to access your Notebook in order to deliver HTML to users.
Even when Notebooks are just running on your local machine, they are running in a browser that is accessing your...
The standard tool for converting Notebooks to other formats is the use of the nbconvert
utility. It is built into your Jupyter installation. You can access the tool directly in the user interface for your Notebook. If you open a Notebook and select the Jupyter File
menu item, you will see several options for Download as
:
The choices are:
Note
Note: Since we are working with a Scala Notebook, that is the language choice provided on the second choice. If we had a Notebook in another language, that other language would be the choice.
For these examples, if we take a Notebook from a previous chapter, the Jupyter Notebook looks like this:
The Notebook format (.ipynb
) is the native format for your Notebook. We have looked in this file in earlier chapters to see what Jupyter is storing in your Notebook.
You would use the Notebook format if you wanted to give...
In this chapter, we shared Notebooks on a Notebook server. We added a Notebook to our web server, and we distributed a Notebook using GitHub. We also looked into converting our Notebooks into different formats, such as HTML and PDF.
In the next chapter, we will look into allowing multiple users to interact with a Notebook simultaneously.