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.15a1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

clean_notebook-0.1.15a1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file clean_notebook-0.1.15a1.tar.gz.

File metadata

  • Download URL: clean_notebook-0.1.15a1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for clean_notebook-0.1.15a1.tar.gz
Algorithm Hash digest
SHA256 eb89ab61db0e005eafa945fa57aa4da38a08d0606fe1983a34aa98255f2a7816
MD5 ae405665fe4d6151667e19061704acdf
BLAKE2b-256 9f73e390e4d81b707892e3bf7ac7c25e83fb4945b41d018879911d6dbff789ce

See more details on using hashes here.

File details

Details for the file clean_notebook-0.1.15a1-py3-none-any.whl.

File metadata

File hashes

Hashes for clean_notebook-0.1.15a1-py3-none-any.whl
Algorithm Hash digest
SHA256 acb3942e6c1af6cf5121c26f7b4e6ea71dc43d57fc7e2d7c01ada9682b38706f
MD5 49285822e9af360b849bfe4c1104dfa6
BLAKE2b-256 387d4862d025650a3e391e51701c6bc1934f2c3f3e689f3d551108d46a3f98df

See more details on using hashes here.

Supported by

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