
- Jupyter Tutorial
- Jupyter - Home
- IPython
- IPython - Introduction
- IPython - Installation
- IPython - Getting Started
- Running & Editing Python Script
- IPython - History Command
- IPython - System Commands
- IPython - Command Line Options
- Dynamic Object Introspection
- IPython - IO Caching
- Setting IPython as Default Python Environment
- Importing Python Shell Code
- IPython - Embedding IPython
- IPython - Magic Commands
- Jupyter
- Project Jupyter - Overview
- Jupyter Notebook - Introduction
- Working With Jupyter Online
- Installation and Getting Started
- Jupyter Notebook - Dashboard
- Jupyter Notebook - User Interface
- Jupyter Notebook - Types of Cells
- Jupyter Notebook - Editing
- Jupyter Notebook - Markdown Cells
- Cell Magic Functions
- Jupyter Notebook - Plotting
- Converting Notebooks
- Jupyter Notebook - IPyWidgets
- QtConsole
- QtConsole - Getting Started
- QtConsole - Multiline Editing
- QtConsole - Inline Graphics
- QtConsole - Save to Html
- QtConsole - Multiple Consoles
- Connecting to Jupyter Notebook
- Using github and nbviewer
- JupyterLab
- JupyterLab - Overview
- Installation & Getting Started
- JupyterLab - Interface
- JupyterLab - Installing R Kernel
- Jupyter Resources
- Jupyter - Quick Guide
- Jupyter - Useful Resources
- Jupyter - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Jupyter - Converting Notebooks
Jupyter notebook files have .ipynb extension. Notebook is rendered in web browser by the notebook app. It can be exported to various file formats by using download as an option in the file menu. Jupyter also has a command line interface in the form of nbconvert option. By default, nbconvert exports the notebook to HTML format. You can use the following command for tis purpose −
jupyter nbconvert mynotebook.ipynb
This will convert mynotebook.ipynb to the mynotebook.html. Other export format is specified with `--to` clause.
Note that other options include ['asciidoc', 'custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides']
HTML includes 'basic' and 'full' templates. You can specify that in the command line as shown below −
jupyter nbconvert --to html --template basic mynotebook.ipynb
LaTex is a document preparation format used specially in scientific typesetting. Jupyter includes 'base', 'article' and 'report' templates.
jupyter nbconvert --to latex –template report mynotebook.ipynb
To generate PDF via latex, use the following command −
jupyter nbconvert mynotebook.ipynb --to pdf
Notebook can be exported to HTML slideshow. The conversion uses Reveal.js in the background. To serve the slides by an HTTP server, add --postserve on the command-line. To make slides that does not require an internet connection, just place the Reveal.js library in the same directory where your_talk.slides.html is located.
jupyter nbconvert myslides.ipynb --to slides --post serve
The markdown option converts notebook to simple markdown output. Markdown cells are unaffected, and code cells indented 4 spaces.
--to markdown
You can use rst option to convert notebook to Basic reStructuredText output. It is useful as a starting point for embedding notebooks in Sphinx docs.
--to rst
This is the simplest way to get a Python (or other language, depending on the kernel) script out of a notebook.
--to script