Jupyter (IPython) notebook: Convert an HTML notebook to ipynb

I recently used BeautifulSoup and JSON to convert html notebook to ipynb. the trick is to look at the JSON schema of a notebook and emulate that. The code selects only input code cells and markdown cells here is my code from bs4 import BeautifulSoup import json import urllib.request url=”http://nbviewer.jupyter.org/url/jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb” response = urllib.request.urlopen(url) # for … Read more

export notebook to pdf without code [duplicate]

I found this article interesting it explains how to remove the input columns : you have to create a template file named “hidecode.tplx” in same directory as the notebook you want to convert and add those line in it : ((*- extends ‘article.tplx’ -*)) ((* block input_group *)) ((*- if cell.metadata.get(‘nbconvert’, {}).get(‘show_code’, False) -*)) ((( … Read more

How to run an .ipynb Jupyter Notebook from terminal?

nbconvert allows you to run notebooks with the –execute flag: jupyter nbconvert –execute <notebook> If you want to run a notebook and produce a new notebook, you can add –to notebook: jupyter nbconvert –execute –to notebook <notebook> Or if you want to replace the existing notebook with the new output: jupyter nbconvert –execute –to notebook … Read more