nbstripout
Strips outputs from Jupyter and IPython notebooks
What it is and what it does
nbstripout is a command-line tool that removes output cells and selected metadata from Jupyter and IPython notebooks. It reads a notebook file (or stdin), strips execution results and some metadata, and writes the cleaned version back to the original file or stdout. The tool is designed to be used as a Git filter or pre-commit hook, allowing developers to keep notebook output on disk while preventing it from being committed to version control. This reduces repository size and minimizes diffs when notebooks are re-executed.
The package supports multiple notebook formats including standard Jupyter notebooks (.ipynb) and Zeppelin notebooks (.zpln). It offers both direct file processing and integration with Git workflows through filter installation commands. It can operate on single files, multiple files, or recursively on directories, and includes dry-run and verification modes to preview changes before applying them.
Use it for:
- Set up a Git filter to automatically strip notebook output before commits, keeping repositories clean without manual intervention.
- Use as a pre-commit hook in a data science project to ensure notebooks are committed without execution artifacts.
- Retroactively clean output from existing notebooks in a repository using git filter-repo integration.
- Process notebooks in a CI/CD pipeline to verify they can be stripped without errors before merging.
- Strip output from notebooks before sharing them in pull requests to reduce diff noise and file size.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Strips output cells and metadata from Jupyter and IPython notebooks, typically for use as a Git filter to keep notebooks clean in version control without losing local output.
Yes. This is a stable, actively maintained tool with low install friction and a single lightweight dependency. It solves a real problem for teams using Jupyter notebooks in Git workflows. The MIT license is permissive, there are no known vulnerabilities, and the package is in the top 5000 by download volume. Install it if you work with notebooks in version control.
Install
nbstripout on PyPI
pip
pip install nbstripoutuv
uv add nbstripoutpoetry
poetry add nbstripoutInstalling nbstripout
Before you install
Low friction: single runtime dependency (nbformat), pure Python wheel, and actively maintained with a recent release. Requires Python 3.10 or later.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install nbstripout
nbstripout notebook.ipynb
# Or set up as a Git filter:
nbstripout --install
Requires Python 3.10 or later; nbformat must be installed as a runtime dependency.
Verify before relying
- Whether the package handles all notebook formats (Zeppelin, standard Jupyter) equally well in practice.
- Performance characteristics when processing large notebooks or many files in a repository.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — nbformat |
| Maintenance | actively maintained — 174 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,885,518/month — #3,465 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: nbstripout-0.9.1-py3-none-any.whl
Keywords: jupyter, notebook, ipython, git, filter, hooks
Tags
More Version Control packages
Automatically extracts and manages Python…
permissive · top 1,000 on PyPI
dulwichDulwich provides pure Python access to Git…
unclear · top 1,000 on PyPI
setuptools-rustsetuptools-rust is a setuptools plugin that…
permissive · top 5,000 on PyPI
pygit2pygit2 provides Python bindings to libgit2,…
copyleft · top 5,000 on PyPI
poetry-dynamic-versioningA Poetry plugin that automatically derives and…
permissive · top 5,000 on PyPI
whatthepatchParses and applies patch files in multiple diff…
permissive · top 5,000 on PyPI
nb-cleannb-clean removes execution counts, metadata,…
permissive · top 15,000 on PyPI
nbvalA pytest plugin that treats Jupyter notebooks…
permissive · top 15,000 on PyPI
nbsphinxnbsphinx is a Sphinx extension that parses…
permissive · top 5,000 on PyPI
jupytextJupytext converts Jupyter notebooks to and from…
permissive · top 5,000 on PyPI
scrapbookScrapbook records data values and visual…
permissive · top 5,000 on PyPI
nbmakeA pytest plugin that executes Jupyter notebooks…
permissive · top 15,000 on PyPI
nbqaRuns standard Python linters and formatters…
permissive · top 15,000 on PyPI
mkdocs-jupyterConverts Jupyter notebooks and Python scripts…
permissive · top 15,000 on PyPI
git-filter-repoRewrites git repository history efficiently,…
permissive · top 5,000 on PyPI
jupyter-cacheCaches Jupyter notebook execution outputs to…
permissive · top 5,000 on PyPI