Tools to work with Jupyter notebooks
Project description
nbtoolbelt - 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:
python setup.py check -r -s
- create source distribution and wheel:
python setup.py sdist bdist_wheel
- test package configuration:
-
In
nbtoolbelt/dist/
- create digital signature:
gpg --detach-sign -a ...
- upload to PyPI:
twine upload ...
- create digital signature:
-
In
nbtoolbelt/src/
,- determine size of code:
wc `find . -name '*.py'`
- determine size of code:
Steps to add a feature:
-
Add issue.
-
Design interface.
-
Add (failing) test cases in
nbtoolbelt/test/
. -
Add documentation in
nbtoolbelt/docs/
.
-
-
Implement feature in
nbtoolbelt/src/nbtoolbelt/
. -
Update
nbtoolbelt/src/nbtoolbelt/_version.py
. -
Update
CHANGELOG.rst
. -
Commit and push changes.
-
Close issue, indicating commit hash.
License
Copyright (c) 2017 - Eindhoven University of Technology, The Netherlands
This software is made available under the terms of the MIT License.
Resources
- Python: Python 3
- Jupyter
- Jupyter notebook format
- Documentation
- Includes a format validator based on JSON schemas, such as nbformat.v4.schema.json
- JSON Schema
- ./jq: a lightweight and flexible command-line JSON processor
- Python 3 Patterns, Recipes and Idioms
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nbtoolbelt-2024.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1075c1b7c3724d1ec91acef5ddf96a1b0decdba4fefcb44b146f2f2f319e705 |
|
MD5 | a85b90412d118549a197848949318eae |
|
BLAKE2b-256 | d48f63dc25a0da6e7a461d4c27c46e027b9c55ea1affcf5d91b7d6b7427a2109 |