Clean up notebook
A simple command to clean up your Jupyter notebooks.
Usage
If you want to run this tool in a CLI, pipx is advised.
pipx install clean-notebook
To use clean-notebook with pre-commit, add this to your .pre-commit-config.yaml:
- repo: https://github.com/hoxbro/clean_notebook
rev: "" # Use the sha / tag you want to point at
hooks:
- id: clean-notebook
Configuration
To clean a notebook run the command clean-notebook example.ipynb or if you want to do it for multiple files clean-notebook example1.ipynb example2.ipynb.
The following arguments are supported --dry-run to not overwrite the file and --keep-empty to keep empty cells. If you want not to delete a specific metadata key, the -i/--ignore argument can be used. If more keys should be ignored: clean-notebook . -i tags -i slideshow. If you want remove ending newlines in code cells, use the -s/--strip-trailing-newlines argument.
Metadata
Release files for clean-notebook 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clean_notebook-0.2.1.tar.gz | 9.9 kB | With provenance | Details for clean_notebook-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clean_notebook-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for clean_notebook-0.2.1-py3-none-any.whl |
Total release size: 15.8 kB
Release files / clean_notebook-0.2.1.tar.gz
| Download URL | clean_notebook-0.2.1.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2914a8c541b37a740ab90412e75291521a20f3c47d4c086eb4aebe489a7e30d
|
|
BLAKE2b-256 checksum How to use checksums |
2db454554163914879c3a45587e06692739a33e7fef7af78611c402cc2348269
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 2, 2026.
Transparency logRelease files / clean_notebook-0.2.1-py3-none-any.whl
| Download URL | clean_notebook-0.2.1-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c62b6d8b71e67478e8ae24dafa1b3e1b278d13bd3477b24f6dc632d381fd4ef3
|
|
BLAKE2b-256 checksum How to use checksums |
7c32848ef23c7a5cfcf0edff7385ce92047675ac7cbb8f15c991a6bd8b25d7c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 2, 2026.
Transparency logSecurity for clean-notebook 0.2.1
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
Both files in this release have been uploaded with provenance metadata.
Attestation for clean_notebook-0.2.1.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 Mar 2, 2026.
Transparency logA 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.