skillfed

nbstripout

Strips outputs from Jupyter and IPython notebooks

nbstripout v0.9.1 1.9M downloads/30d#3,465 on PyPI1,476
Permissive license MIT Active released

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 nbstripout

uv

uv add nbstripout

poetry

poetry add nbstripout

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleFramework :: IPythonFramework :: JupyterIntended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Version Control

Tags

jupyter notebook output removalstrip jupyter cell outputgit filter jupyter notebooksclean ipython notebooknotebook version controljupyter pre-commit hookremove notebook execution results
jupytergit-integrationnotebook-tools

More Version Control packages