Skip to main content

nbclear

A tool (and pre-commit hook) to automatically remove the output from all code cells in all Jupyter notebooks.

Installation

pip install nbclear

As a pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

-   repo: https://github.com/ozen/nbclear
    rev: v0.1.0
    hooks:
    -   id: nbclear

Behavior

The tool opens the notebook and clears the outputs of cells in the memory.
If there are no changes in the notebook, it quits without further action.
If there are changes, it moves the original file notebook.ipynb to notebook.ipynb~ and saves the cleared notebook to notebook.ipynb.
If the backup cannot be created, it prints the error and quits.

Metadata

Release files for nbclear 0.1.0

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

Source distribution (sdist)

Source distribution for nbclear 0.1.0
File Size Uploaded Provenance Actions
nbclear-0.1.0.tar.gz 3.3 kB Without provenance Details for nbclear-0.1.0.tar.gz

Release files / nbclear-0.1.0.tar.gz

Download URL nbclear-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ee95483e1c1f41cab759b56b13d67d40cb84f2d05cf1fe5bf58d1a787ad6e41f
BLAKE2b-256 checksum
How to use checksums
df4810e45615c45da9c420256bbc5575007f27677a2c423b81ad9596af02b71b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.1

Security for nbclear 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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