Skip to main content

nbtoolbelt - Tools to Work with Jupyter Notebooks

  • validate: validate notebooks
  • head: show head or tail of notebooks
  • dump: dump notebook info and source on terminal
  • stats: summarize notebooks with statistics
  • view: view notebook, including all embedded images, LaTeX, and HTML in a browser
  • cat: concatenate multiple notebooks
  • clean: clean notebooks by removing specified elements
  • run: execute notebooks, with pre/post cleaning
  • split: split notebooks into MarkDown, code, and raw
  • punch: 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'`
  • In nbtoolbelt/test/,

    • run all test cases: pytest .
  • In nbtoolbelt/,

    • test package configuration: python setup.py check -r -s
    • create source distribution and wheel: python setup.py sdist bdist_wheel
  • In nbtoolbelt/dist/

    • create digital signature: gpg --detach-sign -a ...
    • upload to PyPI: twine upload ...
  • In nbtoolbelt/src/,

    • determine size of code: wc `find . -name '*.py'`

Steps to add a feature:

  1. Add issue.

  2. Design interface.

    1. Add (failing) test cases in nbtoolbelt/test/.

    2. Add documentation in nbtoolbelt/docs/.

  3. Implement feature in nbtoolbelt/src/nbtoolbelt/.

  4. Update nbtoolbelt/src/nbtoolbelt/_version.py.

  5. Update CHANGELOG.rst.

  6. Commit and push changes.

  7. 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

Metadata

Release files for nbtoolbelt 2026.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nbtoolbelt 2026.4.1
File Size Uploaded
nbtoolbelt-2026.4.1.tar.gz 38.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nbtoolbelt 2026.4.1
File Interpreter ABI Platform
nbtoolbelt-2026.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 90.7 kB

Release files / nbtoolbelt-2026.4.1.tar.gz

Download URL nbtoolbelt-2026.4.1.tar.gz
Size 38.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b92f7711442cb970099821a094654d16dfc71299840ff2b1adbcab7322b6060c
BLAKE2b-256 checksum
How to use checksums
b34d1b08a35812fed462c1629330970191705e67d0c6f3fff7ad9757d139e116
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / nbtoolbelt-2026.4.1-py3-none-any.whl

Download URL nbtoolbelt-2026.4.1-py3-none-any.whl
Size 51.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff4ed0cdc98216843e675ba53fd850af9c51de3b1560966e6ab4b15a0a179ef4
BLAKE2b-256 checksum
How to use checksums
90821a90be22a5a6cf6ef5551f776e7738d1297eb938ed1492a8d561d3bedd9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

2026.4.1 This release

2 release files

2024.7

2 release files

2022.4

2 release files

2022.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page