Tools to work with Jupyter notebooks
Maintained. Last release 7 months ago. Weaker on release cadence.
pip install nbtoolbeltnbtoolbelt - Tools to Work with Jupyter Notebooks
validate: validate notebookshead: show head or tail of notebooksdump: dump notebook info and source on terminalstats: summarize notebooks with statisticsview: view notebook, including all embedded images, LaTeX, and HTML in a browsercat: concatenate multiple notebooksclean: clean notebooks by removing specified elementsrun: execute notebooks, with pre/post cleaningsplit: split notebooks into MarkDown, code, and rawpunch: punch holes into notebooks and fill them (for creating exercises)
Available as library functions and as configurable command-line scripts.
Installation
pip install nbtoolbelt
Documentation
Documentation is available on Read the Docs.
On the command line,
you can use the options -h or --help.
Usage
On the command line:
nbtb [-h] [options] tool [options] nb.ipynb ...
As library: see documentation
Testing
pip install nbtoolbelt[test]
nbtoolbelt comes with a set of automatic test cases for pytest.
Developing
Some useful commands, and where to run them:
-
In
nbtoolbelt/docs/,- clean build directory:
make clean - create html documentation tree:
make html - create pdf documentation:
make latexpdf - determine size of documentation:
wc `find . -name '*.rst'`
- clean build directory:
-
In
nbtoolbelt/test/,- run all test cases:
pytest .
- run all test cases:
-
In
nbtoolbelt/,- test package configuration: