cleannb
is a command line program for cleaning jupyter notebook.
It removes empty cells, clears output, and formats code written in python (using isort and black) and (coming soon) julia (using CleanCode.jl).
Official janitor of Google Colab.
pip install git+https://github.com/KwatME/CleanNB.py
cleannb a.ipynb
cleannb a.ipynb b.ipynb
cleannb *.ipynb
find . -name "*.ipynb" -exec cleannb {} \;
notebook/dirty.ipynb is a dirty notebook. (Make it dirtier and submit your pull request.)
Let's clean it:
cleannb --new notebook/dirty.ipynb
And look at the result notebook/dirty.clean.ipynb.