A simple package to clean Jupyter notebooks
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file clean_notebook-0.1.15.tar.gz
.
File metadata
- Download URL: clean_notebook-0.1.15.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e7ec8cff0b6f837aa763e27731da2f18e088291f950221e3b717ef83925af43 |
|
MD5 | 2c45d5f51873b289dd4e2d5b812aee02 |
|
BLAKE2b-256 | e8fa03a1ac85302e17192e2aca7716bb5e0fd877ccf42b26ac2c2a263a12098a |
File details
Details for the file clean_notebook-0.1.15-py3-none-any.whl
.
File metadata
- Download URL: clean_notebook-0.1.15-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7921bd9761ae41a4a0cf9907bcc18b7d4ff1ad8aab3fb047e0fcda7060fd65b |
|
MD5 | eb0bb7e25174762d0c20e41692709532 |
|
BLAKE2b-256 | 98338b2242331097c513c445f1d62ddc543615f025e57d4b60f27751323f0e05 |