How cambiahealth/nbstripout works
nbstripout is a command-line utility and Git filter that cleans notebook content before it is committed, while leaving the on-disk notebook unchanged when used as a filter. The principal workflow reads a Jupyter notebook, applies configurable cleanup, and writes cleaned output or reports whether changes would occur. Zeppelin notebooks have a separate output-stripping path. The CLI also installs, removes, and reports Git filter configuration. The excerpts show the CLI-to-cleanup call and cleanup behavior; other relationships below are documented in the README, so unsampled implementation details are not inferred.
Main entry points: _nbstripout.py Command handling · _utils.py Jupyter cleanup
Components 8
CLI and Git setup
- Command handling
nbstripout/_nbstripout.py - Filter setup
nbstripout/_nbstripout.py
Notebook cleaning
- Jupyter cleanup
nbstripout/_utils.py - Zeppelin cleanup
nbstripout/_utils.py
Other components
- User or Git
- Notebook data
- Git configuration
- nbformat parser
Connections 10
- User or Git → Command handling: runs command
README.md - Command handling → nbformat parser: reads notebook
nbstripout/_nbstripout.py - Command handling → Jupyter cleanup: calls cleanup
nbstripout/_nbstripout.py - Command handling → Zeppelin cleanup: dispatches mode
README.md - Jupyter cleanup → Notebook data: cleans content
nbstripout/_utils.py - Zeppelin cleanup → Notebook data: clears results
nbstripout/_utils.py - Command handling → Notebook data: writes output
README.md - User or Git → Filter setup: installs filter
README.md - Filter setup → Git configuration: configures filter
README.md - Git configuration → Command handling: runs clean filter
README.md