nb-clean
Clean Jupyter notebooks for versioning
Decision gist · record as of 2026-08-14
Yes. nb-clean solves a real problem for teams using Jupyter in version control: it eliminates noise from execution state and metadata, making diffs readable and reducing merge conflicts. The package is stable (Production/Stable status), actively maintained, has no known vulnerabilities, and integrates seamlessly into standard Git workflows. Install it if you commit notebooks to Git.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low install friction with a single runtime dependency (nbformat).
- Active maintenance with recent commits and a stable release history since 2017.
License · maintenance · safety
ISC (permissive) — ISC license is permissive and imposes minimal restrictions; you can use, modify, and distribute nb-clean freely in commercial and private projects.
last release 2024-10-19 (664 days) · last repo commit 2026-08-01 · 199 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 111,278 downloads/mo, #12,422 on PyPI
Alternatives
Verify before relying
pip install nb-clean
nb-clean check notebook.ipynb
nb-clean clean notebook.ipynb- Whether the Git filter approach preserves working-directory visibility of outputs as claimed in the description.
- Performance characteristics when processing large notebooks or batch operations.
What it is and what it does
nb-clean is a command-line tool and Python library that strips transient metadata from Jupyter notebooks—execution counts, cell outputs, and notebook metadata—to reduce noise in version control diffs. It works by removing information that changes every time a notebook is run but carries no semantic value for code review or collaboration.
The package integrates directly into your Git workflow via a configurable filter (which cleans notebooks as they're staged) or as a pre-commit hook (which modifies notebooks on disk before commit). It can also be used standalone to check whether a notebook is clean or to clean notebooks in place. Fine-grained flags let you preserve specific metadata fields (like tags for tools such as papermill) or outputs when needed.
Use it for
- Automatically clean notebooks before each Git commit using a pre-commit hook to keep diffs focused on actual code changes.
- Check notebooks in CI pipelines to enforce that committed notebooks contain no execution counts or stale outputs.
- Preserve specific cell metadata fields (e.g., tags) while removing outputs, for workflows that rely on notebook annotations.
- Use as a Git filter to clean notebooks on staging without modifying your local working copy.
- Integrate into a Python script to programmatically clean or validate notebooks as part of a data pipeline.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
nb-clean solves a real problem for teams using Jupyter in version control: it eliminates noise from execution state and metadata, making diffs readable and reducing merge conflicts. The package is stable (Production/Stable status), actively maintained, has no known vulnerabilities, and integrates seamlessly into standard Git workflows. Install it if you commit notebooks to Git.
Install
nb-clean on PyPI
Before you install
Low install friction with a single runtime dependency (nbformat). Active maintenance with recent commits and a stable release history since 2017. Supports Python 3.9 through 3.13.
Requires Python 3.9 or later.
License in practice
ISC license is permissive and imposes minimal restrictions; you can use, modify, and distribute nb-clean freely in commercial and private projects.
Quickstart
pip install nb-clean
nb-clean check notebook.ipynb
nb-clean clean notebook.ipynb
Verify before relying
- Whether the Git filter approach preserves working-directory visibility of outputs as claimed in the description.
- Performance characteristics when processing large notebooks or batch operations.
Package facts
| License | ISC permissive |
| Python support | Supports the current Python release <4.0,>=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagenbformat |
| Maintenance | Actively maintained 664 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 111,278 / month, #12,422 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI ApprovedNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9 |
Evidence: nb_clean-4.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “clean notebook metadata”
- nb-cleannb-clean removes execution counts, metadata, and outputs from Jupyter…
- nbstripoutStrips output cells and metadata from Jupyter and IPython notebooks,…
- nbtoolbeltnbtoolbelt provides command-line and library tools for validating,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also nbstripout · nbtoolbelt · nbval · jupytext · execnb · nbqa · jupyter-cache · nbdev · nbmake · scrapbook