qmetrics.net

nbstripout

CLI tool to strip Jupyter notebook outputs for Git

nbstripout screenshot

nbstripout removes notebook outputs and selected metadata while keeping cells. It is meant as a Git filter or hook so commits stay small and diff-friendly.

Overview

nbstripout reads Jupyter, IPython, or Zeppelin notebook files and strips execution output plus configurable metadata, then writes the cleaned notebook back to disk or stdout. Behavior is similar to clearing all outputs in the notebook UI, but filtering happens when Git records versions so local outputs can remain on disk.

The command supports in-place editing, pipelines, dry-run and verify modes, and recursive processing. Optional flags drop empty cells, tagged cells, init cells, or specific output types while preserving counts, cell IDs, or outputs marked with metadata or tags.

Install via pip or conda, then register with `nbstripout --install` as a required Git filter at repository, global, or system scope. Attributes can live in `.gitattributes` so teams share rules. The tool can rewrite history with git-filter-repo scripts for existing repositories.

Global and system installs apply the filter to all `.ipynb` files across machines. Extra metadata keys to strip or keep can be set through Git config or CLI flags.

Key features

  • Strip Jupyter and Zeppelin outputs
  • Git filter and diff driver setup
  • Keep output locally, omit from commits
  • Drop empty or tagged cells
  • Configurable metadata stripping
  • Dry-run and verify modes
  • Global or per-repo install
  • Pipeline and stdin or stdout use

Use cases

  • Cleaner Git diffs for notebooks
  • Smaller notebook commits without images
  • Team-wide output stripping policy
  • CI verification that outputs are stripped
  • Retroactive history cleanup for ipynb

Tags

Similar software

Husky

Lightweight native Git hooks for Node projects

Husky wires Git hooks so teams can lint commit messages, run tests, or check code on commit and push. It uses core.hooksPath, stays around two kilobytes gzipped, and supports macOS, Linux, and Windows.

★ 35.4k⟳ 8 months agoMIT

Playwright

Cross-browser web automation and testing framework

Playwright drives Chromium, Firefox, and WebKit through one API for tests, scripts, and agent-driven browser control.

★ 101.2k⟳ yesterdayApache-2.0

Puppeteer

JavaScript library for automating Chrome and Firefox

Puppeteer exposes a high-level JavaScript API to drive Chrome or Firefox through the DevTools Protocol or WebDriver BiDi. It defaults to headless browser control for scripts and tests.

★ 95.9k⟳ yesterdayApache-2.0

Storybook

Isolated workshop for UI components and pages

Storybook runs a local dev workshop where teams build, test, and document components in isolation. It integrates with major frontend frameworks and addons for docs, accessibility, visual review, and agent tooling.

★ 91.7k⟳ todayMIT

Lazygit

Terminal user interface for everyday Git workflows

Lazygit wraps common Git operations in a keyboard-driven terminal UI. You can stage partial changes, rebase, cherry-pick, and inspect history without memorizing fragile command sequences.

★ 84.1k⟳ 5 days agoMIT

act

Local runner for GitHub Actions workflows

A command-line tool that executes GitHub Actions workflows on your machine using Docker. It mirrors GitHub’s environment for faster feedback while editing workflow files.

★ 72.8k⟳ 12 days agoMIT
Build & DeploymentDesktop/CLI app