Skip to content

Instantly share code, notes, and snippets.

View lezuber's full-sized avatar

Lenz Zuber lezuber

View GitHub Profile
@minrk
minrk / nbstripout
Last active March 12, 2025 18:41
git pre-commit hook for stripping output from IPython notebooks
#!/usr/bin/env python
"""strip outputs from an IPython Notebook
Opens a notebook, strips its output, and writes the outputless version to the original file.
Useful mainly as a git filter or pre-commit hook for users who don't want to track output in VCS.
This does mostly the same thing as the `Clear All Output` command in the notebook UI.
LICENSE: Public Domain