Jupyter is JSON

Jupyter notebooks are JSON files that can be manipulated easily
Python
Author

Isaac Flath

Published

January 15, 2020

Today I Learned

Jupyter notebooks are JSON files that can be manipulated easily.

To read them:

import json
nb = json.load(open(fpath))

To clear outputs

for cell in nb['cell']:
    if cell.cell_type=='code': cell['outputs']=[]

All normal json and easy to work with when needed. nbdev has lots of functions and tools to make most of this easier too.