Export Jupyter Notebooks

Jupyter Notebook provides a lot of options to users to export their notebooks in different formats which are as follows:

  1. PDF (.pdf)
  2. Python (.py)
  3. Notebook (.pynb)
  4. Markdown (.md)
  5. HTML (.html)
  6. LaTeX (.tex)
  7. Rest (.rst)
  8. Acsciidoc (.asciidoc)
  9. Reveal.js slides (.slides.html)

Export Notebook via Web-Based User Interface

To export or download your notebook in any above-mentioned formats follow the below steps:

  1. Click on the Files button on the Menu Bar
  2. Click on Download as button
  3. You will see different options to download you notebook in different formats which are mentioned in this article earlier.
  4. Select the format which suits you best

Output

Export Notebook via Command Line Interface

To export the jupyter notebook via command line you must install the nbconvert module, to install the nbconvert module you the below code block and run it in either terminal or jupter notebook.

pip install nbconvert

Syntax for the command is as follows

jupyter nbconvert –to [format] [notebook_name].ipynb

Replace,

[format] with any format mentiond in the list [‘asciidoc’, ‘custom’, ‘html’, ‘latex’, ‘markdown’, ‘notebook’, ‘pdf’, ‘python’, ‘rst’, ‘script’, ‘slides’, ‘webpdf’]

[notebook_name] with the name of you notebook

Example: Convert the notebook to Markdown

 jupyter nbconvert --to markdown notebook.ipynb


Output

In the below screenshot %%bash magic cell function is used because command is running in the Jupyter notebook, if you directly run the command in terminal you have to only write the command.

Verify if the notebook is exported as markdown or not, in the below screenshot you can clearly see the exported notebook in markdown format highlighted in the red box.

How to Export and Share Jupyter Jootbooks ?

In this article, we will cover How to export and share Jupyter Notebooks there are different options available in Jupyter Notebook to export/download the notebook in different formats like PDF, Markdown, HTML, etc, we will consider both methods web-based user interface and command-line interface to export the notebook, further we cover an example to get a better understanding and later in the article, we will discuss different options available to share Jupyter Notebooks.

Similar Reads

Export Jupyter Notebooks

Jupyter Notebook provides a lot of options to users to export their notebooks in different formats which are as follows:...

Sharing Jupyter Notebook

After you download the notebook you can share the notebook using any platform E-Mail, GitHub or any messaging apps. But we will discuss three best options to share the notebooks:...