Skip to content

Instantly share code, notes, and snippets.

View masdeseiscaracteres's full-sized avatar

ÓscarGF masdeseiscaracteres

View GitHub Profile
@bsmith89
bsmith89 / ipynb_output_filter.py
Last active August 24, 2022 07:00
Git clean/smudge filter for removing output and line numbers from IPython Notebooks.
#! /usr/bin/env python
"""From http://stackoverflow.com/a/20844506/1951857
To use::
# Add the script to your path
chmod +x path/to/this/ipynb_output_filter.py
echo "*.ipynb filter=dropoutput_ipynb" >> ~/.gitattributes
git config --global core.attributesfile ~/.gitattributes
git config --global filter.dropoutput_ipynb.clean ipynb_output_filter.py