Exporting an IPython Notebook Dashboard to HTML

In this recipe, you'll learn how to export an IPython Notebook dashboard to an HTML file, which you can share with others by deploying to a web server or uploading to a file server. This is, hands down, the easiest way to share a completed analysis. Combined with scheduling the export, you can keep your customers up to date with the most recent analysis of the most up-to-date data.

Getting Ready…

Before running the following commands, install the nbconvert utility. We'll use this to convert the notebook to the various file formats by running a command in the terminal:

pip install nbconvert

Next, build your dashboard using the Build a shareable Dashboard using IPython Notebook and matplotlib recipe. With that complete, you're ready to export it to an HTML file.

How to do it…

  1. Open a terminal session. On my Mac, I use iTerm2.
  2. Change into the directory that contains your dashboard file.
  3. Run the following command, replacing name_of_notebook.ipynb with the full name of your notebook file:
    jupyter nbconvert --to html --execute 'name_of_notebook.ipynb'
    

That's it!

How it works…

Creating the dashboard was, frankly, the hardest part. With that complete, we installed the nbconvert utility. We then used nbconvert to execute our dashboard using the --execute argument, and exported it to an HTML file using the --to html argument. The resulting file will look something like the following:

How it works…

See Also…

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset