Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clean_notebook-0.1.17.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

clean_notebook-0.1.17-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file clean_notebook-0.1.17.tar.gz.

File metadata

  • Download URL: clean_notebook-0.1.17.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for clean_notebook-0.1.17.tar.gz
Algorithm Hash digest
SHA256 32ffbcef66da86b848c4939cbcee77c3b2a9dc1de69148a50e27a277d552a447
MD5 2bcf8a49752deed3a2698c19906248b1
BLAKE2b-256 19f479cecc09d4babf44ab1ab31b5936914a57b756656deb4662acce2e007de2

See more details on using hashes here.

Provenance

The following attestation bundles were made for clean_notebook-0.1.17.tar.gz:

Publisher: build.yaml on hoxbro/clean_notebook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clean_notebook-0.1.17-py3-none-any.whl.

File metadata

File hashes

Hashes for clean_notebook-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 041250bdd26923a9bb5c23899f88a7acd37d362510ba9312042b2739c13a0f59
MD5 a0b8aa79a1309a91746271aa340e2dd6
BLAKE2b-256 3b6f2b514c298b4a01da0f1abf5ddd923446289421564f13d0661f2aea8b683b

See more details on using hashes here.

Provenance

The following attestation bundles were made for clean_notebook-0.1.17-py3-none-any.whl:

Publisher: build.yaml on hoxbro/clean_notebook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page