Skip to main content

Clean Jupyter notebooks for versioning

Project description

nb-clean

nb-clean cleans Jupyter notebooks of cell execution counts, metadata, and outputs, preparing them for committing to version control. It provides a Git filter to automatically clean notebooks before they are staged, and can also be used as a standalone tool outside Git or with other version control systems.

Installation

To install the latest release from PyPI, use pip:

pip install nb-clean

Alternately, in Python projects using Poetry or Pipenv for dependency management, add nb-clean as a development dependency with poetry add --dev nb-clean or pipenv install --dev nb-clean. nb-clean requires Python 3.6 or later.

Usage

To install a filter in an existing Git repository to automatically clean notebooks before they are staged, run the following from the working tree:

nb-clean configure-git

nb-clean will configure a filter in the Git repository in which it is run, and will not mutate your global or system Git configuration. To remove the filter, run:

nb-clean unconfigure-git

Aside from usage from a filter in a Git repository, you can also clean up a Jupyter notebook manually with:

nb-clean clean -i original.ipynb -o cleaned.ipynb

Copyright

Copyright © 2017-2019 Scott Stevenson.

nb-clean is distributed under the terms of the ISC licence.

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

nb-clean-1.3.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nb_clean-1.3.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file nb-clean-1.3.0.tar.gz.

File metadata

  • Download URL: nb-clean-1.3.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Darwin/18.2.0

File hashes

Hashes for nb-clean-1.3.0.tar.gz
Algorithm Hash digest
SHA256 db10c62f61bd5189bf496d3c19fe7c088f0797f677390b8b89937545584a0c2b
MD5 70c5cf0424ff7105a421d9e9ef5d2917
BLAKE2b-256 0a3a0181abbf05494b3a325087453c3dc7e337c37e72ce7bcf2cd841d51b7e49

See more details on using hashes here.

File details

Details for the file nb_clean-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: nb_clean-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Darwin/18.2.0

File hashes

Hashes for nb_clean-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20977a6a40bdd4da937dd77c41bd3882d25960646aac04eba910478ca39c8785
MD5 1e20cc8bbab8d3998544da6d2a4a9220
BLAKE2b-256 36f8661b1ebccb6de83ccd14608eb22ab278fbc8932e0e4b2d1efe9beea4ac0d

See more details on using hashes here.

Supported by

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