Nb-clean

Latest version: v3.2.0

Safety actively analyzes 628989 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

2.2.1

This releases adds a [pre-commit](https://pre-commit.com/) hook.

2.2.0

This release adds a `-o`/`--preserve-cell-outputs` flag to the `check`, `clean`, and `add-filter` subcommands which prevents cell outputs from being cleaned, in the case of `nb-clean check` and `nb-clean add-filter`, or causing the check to fail in the case of `nb-clean check`.

2.1.0

With this minor release `nb-clean` now checks for and cleans the language version from notebook metadata.

2.0.2

This patch release changes the build backend to `poetry-core` in order to make PEP 517 builds faster, and not require Poetry and all its dependencies be installed.

2.0.1

This patch release bumps the `nbformat` version required in order to provide support for using path-like objects.

2.0.0

This major release significantly refactors the codebase. This enables `nb-clean` to be used as a Python library in addition to as a command line tool, and introduces unit tests for both.

When using the `nb-clean` CLI, it is no longer required to pass flags to indicate input and output files, as `nb-clean` will operate on all files passed as positional arguments in place. If no positional arguments are passed, the input notebook is read from standard input and, for the `check` subcommand, the output notebook is written to standard output.

To support this and improve usability, the command line interface has changed. If you upgrade from a previous release, you'll need to migrate to the new interface. The following table maps from the command line interface of `nb-clean` 1.6.0 to that of `nb-clean` 2.0.0.

| Description | `nb-clean` 1.6.0 | `nb-clean` 2.0.0 |
| --------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------- |
| Clean notebook | `nb-clean clean -i/--input notebook.ipynb \| sponge notebook.ipynb` | `nb-clean clean notebook.ipynb` |
| Clean notebook (remove empty cells) | `nb-clean clean -i/--input notebook.ipynb -e/--remove-empty` | `nb-clean clean -e/--remove-empty-cells notebook.ipynb` |
| Clean notebook (preserve cell metadata) | `nb-clean clean -i/--input notebook.ipynb -m/--preserve-metadata` | `nb-clean clean -m/--preserve-cell-metadata notebook.ipynb` |
| Check notebook | `nb-clean check -i/--input notebook.ipynb` | `nb-clean check notebook.ipynb` |
| Check notebook (remove empty cells) | `nb-clean check -i/--input notebook.ipynb -e/--remove-empty` | `nb-clean check -e/--remove-empty-cells notebook.ipynb` |
| Check notebook (preserve cell metadata) | `nb-clean check -i/--input notebook.ipynb -m/--preserve-metadata` | `nb-clean check -m/--preserve-cell-metadata notebook.ipynb` |
| Add Git filter to clean notebooks | `nb-clean configure-git` | `nb-clean add-filter` |
| Remove Git filter | `nb-clean unconfigure-git` | `nb-clean remove-filter` |

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.