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` |