https://github.com/sasso-effe/notebooks-pre-commit
A pre-commit hook for cleaning python notebooks.
https://github.com/sasso-effe/notebooks-pre-commit
clean-code ipython-notebook pre-commit-hooks
Last synced: 26 days ago
JSON representation
A pre-commit hook for cleaning python notebooks.
- Host: GitHub
- URL: https://github.com/sasso-effe/notebooks-pre-commit
- Owner: sasso-effe
- License: unlicense
- Created: 2025-06-19T09:39:41.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-11-28T08:53:57.000Z (6 months ago)
- Last Synced: 2025-11-30T17:50:04.225Z (6 months ago)
- Topics: clean-code, ipython-notebook, pre-commit-hooks
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# notebooks-pre-commit
[](https://badge.fury.io/gh/sasso-effe%2Fnotebooks-pre-commit)
A [pre-commit](https://pre-commit.com/) hook for cleaning python notebooks.
### Images downscaling
To downscale your notebooks' images via pre-commit, add the following to your `.pre-commit-config.yaml`:
```yaml
repos:
- repo: https://github.com/sasso-effe/notebooks-pre-commit
rev: v0.1.0
hooks:
- id: downscale-notebook-images
```
You can disable conversion of PNG images to JPEG with:
```yaml
repos:
- repo: https://github.com/sasso-effe/notebooks-pre-commit
rev: v0.1.0
hooks:
- id: downscale-notebook-images
args: ["--kep-png"]
```
Other options are:
- `--max-img-res`: Resize images that have one side larger than this number (in pixels). Defaults to 800.
- `--max-file-size`: Ignore notebooks smaller than this size (in KB). Defaults to 512.