Easy git tracking of Jupyter lab files
Project description
jupyter-cleaner
jupyter-cleaner makes tracking Jupyter lab files in git easy.
This is done by:
- Removing output of all cells
- Formatting all cells (using black)
- Reordering imports in all cells (using reorder-python-imports)
- Setting the execution count of all cells
It is recommended to run jupyter-cleaner using pre-commit:
default_language_version:
python: python3.11
repos:
- repo: local
hooks:
- id: jupyter_cleaner
name: jupyter_cleaner
entry: jupyter_cleaner .
language: system
pass_filenames: false
always_run: true
CLI
running jupyter_cleaner -h
displays:
jupyter_cleaner
positional arguments:
files_or_dir Jupyter lab files to format or directories to search for lab files
options:
-h, --help show this help message and exit
--execution_count EXECUTION_COUNT
Number to set for the execution count of every cell
--remove_code_output Number to set for the execution count of every cell
--format Format code of every cell (uses black)
--reorder_imports Reorder imports of every cell (uses reorder-python-imports)
pyproject.toml
Inputs to jupyter-cleaner can be supplied via pyproject.toml:
[tool.jupyter_cleaner]
execution_count=0
remove_code_output=true
format=true
reorder_imports=true
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
jupyter_cleaner-0.1.0.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for jupyter_cleaner-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f16a9b089fd3088dd7820e5da4c4bb0ce63ee751504446cefa1a920fca3f3f4f |
|
MD5 | 39951b46880cc3e0e5a0a0dbf3f68431 |
|
BLAKE2b-256 | 8ac84e3bbc7f7c560af1674b573b5cb97dab62e2693150e40bb6c08d52e8ad60 |