Skip to main content

nbwipers

Test License:MIT PyPI - Version Crates.io Conda codecov

nbwipers is a command line tool to wipe clean jupyter notebooks, written in Rust.

The interface and functionality are based on nbstripout and the idea to implement it in rust comes from nbstripout-fast.

Usage

nbwipers has a few subcommands that provide functionality related to cleaning Jupyter notebooks.

  • clean: clean a single notebook. This is more-or-less equivalent to nbstripout.
  • check: check notebooks in a given path for elements that would be removed by clean. This could be used in a CI context to enforce clean notebooks.
  • clean-all clean all notebooks in a given path. This one should be used carefully!
  • install register nbwipers as a git filter for ipynb files. Equivalent to nbstripout --install
  • uninstall remove nbwipers as a git filter.
  • check-install check that nbwipers or nbstripout is installed in the local repo. This is used in the pre-commit hook.
  • show-config show the effective configuration nbwipers would use, merging the config file with any CLI overrides.
  • record record kernel metadata for notebooks in a local, git-untracked store, so it can be restored later even though strip-kernel-info removes it from committed notebooks. See Preserving kernel info locally below.
  • hook subcommands used by pre-commit-style hooks — currently check-large-files, which checks notebook file sizes after cleaning.

The full options can be found in CommandLineHelp.md.

Examples

To set up nbwipers as a git filter in your repository, use

nbwipers install local

If this step is performed on a pre-existing repo, you can touch your notebooks so that git can detect the changes. In bash:

for f in $(git ls-files '*.ipynb'); do touch $f; done

To check the notebooks in your folder, you can run the following

nbwipers check .

To see the configuration nbwipers would use in the current directory, you can run

nbwipers show-config

Add --show-all to also see the default values for settings that have not been explicitly configured.

Preserving kernel info locally

nbwipers install sets up both a clean filter, which strips notebooks before they are committed, and a smudge filter, which runs when notebooks are checked out.

If you enable strip-kernel-info (see Configuration) so that kernelspec and python-version metadata never gets committed, you can still keep that information around locally with record:

nbwipers record .

This saves the kernel metadata for notebooks under the given path to .git/x-nbwipers/kernelspec_store.json — local to your clone and never committed. The next time you check out one of those notebooks, the smudge filter automatically restores its recorded kernel metadata, so each collaborator keeps their own kernel/python version info without it living in version control.

To keep the local store tidy as notebooks come and go:

  • nbwipers record --sync . discards the whole store and rebuilds it from the notebooks currently found under ., dropping entries for notebooks that no longer exist.
  • nbwipers record --remove path/to/notebook.ipynb removes a specific notebook's entry, leaving the rest of the store untouched.
  • nbwipers record --clear wipes the store entirely.

pre-commit

You can add the following to your pre-commit-config.yaml file to ensure that nbwipers or nbstripout is installed in your repo, in order to prevent Jupyter notebook outputs from being committed to version control.

  - repo: https://github.com/felixgwilliams/nbwipers-pre-commit
    rev: v0.7.2
    hooks:
      - id: nbwipers-check-install

Alternatively, you can use the URL for this repo in your config, but this will compile nbwipers from source, rather than retrieving the binary from PyPI, and is therefore not recommended.

If you are using your pre-commit configuration as part of CI, you should set the environment variable NBWIPERS_CHECK_INSTALL_EXIT_ZERO which forces this check to pass, since you do not need nbwipers configured in your CI environment.

Configuration

Configuration is currently done via the tool.nbwipers section of the pyproject.toml file. Most of the command line options can be set per-project in the pyproject.toml, nbwipers.toml or .nbwipers.toml file. If you use pyroject.toml, you need to put the configuration under [tool.nbwipers]. If you use nbwipers.toml or .nbwipers.toml, the configuration needs to be at the top level.

For example you can use strip-kernel-info to remove metadata on the python version or the details about the Jupyter Kernel.

You can also drop cell ids using id-action = "drop".

To enable these options, you can include the following in your pyproject.toml file:

[tool.nbwipers]
strip-kernel-info = true
id-action = "drop"

The equivalent for nbwipers.toml or .nbwipers.toml is just

strip-kernel-info = true
id-action = "drop"

This can be useful when collaborating, as the precise python version and the name assigned to the kernel are ephemeral and can change from person to person. Cell IDs are another element of the file which is generated by the tool you use and can change from person to person.

Motivation

A working copy of a Jupyter notebook contains:

  1. Code written by the author.
  2. Notebook outputs: tables, logs, tracebacks, images, widgets and so on...
  3. Execution counts.
  4. Metadata, such as whether cells are collapsed, scrollable etc.

Of these categories of data, only the first — code written by the author — should definitely be tracked by version control, since it is the product of the author's intention and hard work. The other categories of data are subject to change outside of the explicit intentions of the author and are generally noisy from a version control perspective.

Moreover, including notebook outputs in version control

  • makes diffs harder to interpret, as they will contain lots of unintended changes.
  • increases the risk of a tricky merge conflict if different users run the same cell and get a slightly different result.
  • increases the amount of data committed, which can degrade repository performance.
  • risks leaking sensitive data.

An effective way to ensure you do not commit problematic parts of your notebooks is to use nbwipers or nbstripout as a git filter.

A git filter sits between your actual files and what git sees when you stage and commit your changes. This way, git only sees the transformed version of the file without the problematic elements. At the same time, you do not have to lose them from your local copy.

An exception is when you checkout a branch or do a git pull, which results in changes to the notebook. In this case, your local copy will be replaced by the clean version and you will lose your cell outputs.

Acknowledgements

nbwipers relies on inspiration and code from several projects. For the projects, whose code was used please see LICENSE for the third-party notices.

nbstripout

strip output from Jupyter and IPython notebooks

nbstripout is an invaluable tool for working with Jupyter Notebooks in the context of version control. This project forms the basis of the interface and logic of this project and is also the source of the testing examples.

nbstripout-fast

A much faster version of nbstripout by writing it in rust (of course).

nbstripout-fast, like this project, implements the functionality of nbstripout in Rust, while also allowing repo-level configuration in a YAML file.

With nbwipers I hoped to recreate the idea of nbstripout-fast, but with the ability to install as a git filter, and configuration via pyproject.toml.

ruff

An extremely fast Python linter and code formatter, written in Rust.

Ruff is quickly becoming the linter for python code, thanks to its performance, extensive set of rules and its ease of use. It was a definite source of knowledge for the organisation of the configuration and the file discovery. The schema for Jupyter Notebooks, and some of the file discovery code was adapted from Ruff.

pre-commit

A framework for managing and maintaining multi-language pre-commit hooks.

This repo contains a version of the check-large-files hook, that will not flag notebook files whose clean size is less that the threshold, even if the size on-disk including outputs is greater than the threshold. The logic and interface of the hook was adapted from the pre-commit-hooks repository.

Metadata

Release files for nbwipers 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nbwipers 0.7.2
File Size Uploaded Provenance Actions
nbwipers-0.7.2.tar.gz 82.3 kB With provenance Details for nbwipers-0.7.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for nbwipers 0.7.2
File Actions
nbwipers-0.7.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for nbwipers-0.7.2-py3-none-win_amd64.whl
nbwipers-0.7.2-py3-none-win32.whl Python 3 none Windows x86-32 Details for nbwipers-0.7.2-py3-none-win32.whl
nbwipers-0.7.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for nbwipers-0.7.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
nbwipers-0.7.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl Python 3 none Linux glibc 2.17+ IBM System/390x Details for nbwipers-0.7.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
nbwipers-0.7.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl Python 3 none Linux glibc 2.17+ PowerPC 64-le Details for nbwipers-0.7.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
nbwipers-0.7.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl Python 3 none Linux glibc 2.17+ x86-32 Details for nbwipers-0.7.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
nbwipers-0.7.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl Python 3 none Linux glibc 2.17+ ARMv7l Details for nbwipers-0.7.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
nbwipers-0.7.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for nbwipers-0.7.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
nbwipers-0.7.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for nbwipers-0.7.2-py3-none-macosx_11_0_arm64.whl
nbwipers-0.7.2-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for nbwipers-0.7.2-py3-none-macosx_10_12_x86_64.whl

Total release size: 21.5 MB

Release files / nbwipers-0.7.2.tar.gz

Download URL nbwipers-0.7.2.tar.gz
Size 82.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9a231f53523d4607c079ed7701f25adb19bab6d8f844180824a9bb579483f17b
BLAKE2b-256 checksum
How to use checksums
685664394a4b231f1273d21aea60d0e6358c10f982649836756a71d4abf5a29f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-win_amd64.whl

Download URL nbwipers-0.7.2-py3-none-win_amd64.whl
Size 1.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
8b64b918a41e985627a5d03c81d3da633d68f50b15edce1a49a2e5a49e6260cf
BLAKE2b-256 checksum
How to use checksums
63ad0901493958a022766ea651318385f90885eba643901b2159b6708b5b5d72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-win32.whl

Download URL nbwipers-0.7.2-py3-none-win32.whl
Size 1.7 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
f31e0ffe88860d70f216ae34fb7e3bd9f6ef8ef7aae3ca6b5ee9b16079fa1e59
BLAKE2b-256 checksum
How to use checksums
f9b99dc683f9a2308aeacf00461e69d2eaad63e56891675b9aed3ed2fe7dc1b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nbwipers-0.7.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
723a231fa1e7c31949dd99bfe6ae949ecda3108fc422817765036440c57b0ee1
BLAKE2b-256 checksum
How to use checksums
8cd9872ad314ce8ba182a647de7072cc3053fd962cdde4f1c4266240c7d01544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL nbwipers-0.7.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 2.3 MB
Tags Linux glibc 2.17+ IBM System/390x Python 3
SHA-256 checksum
How to use checksums
bc359ad9d5e44f3a2e8dd78719dba0dc4a4bfbd775d607a84e5f49653e8c0868
BLAKE2b-256 checksum
How to use checksums
29990d40b809abf3f057d631420479de98a2cede29349c3603be95bfad387c95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL nbwipers-0.7.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 2.6 MB
Tags Linux glibc 2.17+ PowerPC 64-le Python 3
SHA-256 checksum
How to use checksums
e9bfb5a9b1d501f4a3b320e7347cc911e9dbf28e59a8796a1352e08c228d7787
BLAKE2b-256 checksum
How to use checksums
775fc3515cc77b36108fa21266f23189cc2b79adfea720d36cd82e05e1f9a14f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL nbwipers-0.7.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Size 2.4 MB
Tags Linux glibc 2.17+ x86-32 Python 3
SHA-256 checksum
How to use checksums
4e831e22b053c2a95a42d4c71e4d8950fd2937622b72737830b6439342517596
BLAKE2b-256 checksum
How to use checksums
4243c2e3118c64151eb63b09104d9202b3145907747c3e9983c2542354e797c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL nbwipers-0.7.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 2.1 MB
Tags Linux glibc 2.17+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
ed4b8aeb030a7eebe269ba40fc6faccafe91af23a52d791835514421e32af021
BLAKE2b-256 checksum
How to use checksums
be9a34a89d423b0dd752b2589b3f4ad5939d8f2a2e0c41c405610ca38ebe0b4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nbwipers-0.7.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.2 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
d99dc6f27dacafc81ae6bd8b4ba3f2faf19d9159bd665871ddee0b6e4ec5ed2b
BLAKE2b-256 checksum
How to use checksums
c805d7d8bc2774293c44ec65918dd364ffbd35fdd87ae5bac7b405e6c1c69c55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-macosx_11_0_arm64.whl

Download URL nbwipers-0.7.2-py3-none-macosx_11_0_arm64.whl
Size 2.0 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b553682d9629a66d23b510545aa218790fe59b2a2b7bbbc9cf6758f2d5ac1624
BLAKE2b-256 checksum
How to use checksums
fe432b886c1d594f7875cac05146dc567a645807f9dd8a2e4b2fa43f6d9f3b32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / nbwipers-0.7.2-py3-none-macosx_10_12_x86_64.whl

Download URL nbwipers-0.7.2-py3-none-macosx_10_12_x86_64.whl
Size 2.1 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
63e079742a468cd46d5dcd6365cd7c1c53e7adc259809d6913b2e4617789c65a
BLAKE2b-256 checksum
How to use checksums
86f90d90f8558555952a14b06efb1fd2a99aa5535c6d47b1e89d60d5e0d3bcbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Security for nbwipers 0.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for nbwipers-0.7.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page