Export Jupyter Notebooks
Jupyter Notebook provides a lot of options to users to export their notebooks in different formats which are as follows:
Export Notebook via Web-Based User Interface
To export or download your notebook in any above-mentioned formats follow the below steps:
- Click on the Files button on the Menu Bar
- Click on Download as button
- You will see different options to download you notebook in different formats which are mentioned in this article earlier.
- 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.