nbtoolbelt
Tools to work with Jupyter notebooks
What it is and what it does
nbtoolbelt is a suite of utilities for working with Jupyter notebooks at scale, available both as command-line scripts and as importable library functions. It wraps nbformat, nbconvert, jupyter-client, and data libraries (numpy, pandas) to provide operations like validation against the notebook schema, statistical summaries, content extraction, and execution with optional pre/post-processing. The package is particularly useful for educators and researchers who need to automate notebook workflows—validating student submissions, generating exercise templates with fill-in-the-blank sections (the 'punch' tool), or batch-processing collections of notebooks for analysis or transformation.
The tool is production-stable (Development Status 5) and has been maintained since 2017. It targets developers, educators, scientists, and system administrators. All operations are available through a single command-line entry point (nbtb) with per-tool options, or as library calls for integration into larger Python workflows.
Use it for:
- Validate a batch of student-submitted notebooks against the Jupyter schema before grading or processing.
- Generate exercise notebooks by punching holes into template notebooks and distributing them for students to fill in.
- Extract and summarize statistics from a collection of notebooks (cell counts, execution time, output sizes).
- Concatenate multiple notebooks into a single document for report generation or archival.
- Clean notebooks by removing execution outputs, metadata, or specific cell types before version control or sharing.
- Execute a notebook with automatic pre-cleaning and post-processing as part of a data pipeline or CI workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
nbtoolbelt provides command-line and library tools for validating, inspecting, cleaning, executing, splitting, and concatenating Jupyter notebooks, plus a specialized tool for creating exercise notebooks with fill-in-the-blank sections.
Yes. nbtoolbelt is a mature, actively maintained utility for Jupyter notebook automation with low install friction, no security vulnerabilities, and a permissive MIT license. Install it if you regularly work with multiple notebooks, need to validate or batch-process them, or want to automate notebook-based workflows (especially in education or research). It is not necessary for casual single-notebook use.
Install
nbtoolbelt on PyPI
pip
pip install nbtoolbeltuv
uv add nbtoolbeltpoetry
poetry add nbtoolbeltInstalling nbtoolbelt
Before you install
Low install friction with a pure-wheel distribution. Actively maintained as of 105 days ago with support for current Python versions (3.10–3.13). Runtime dependencies are all well-established Jupyter ecosystem packages.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for both commercial and open-source projects.
Quickstart
pip install nbtoolbelt
from nbtoolbelt import validate
validate('notebook.ipynb')
# Or via command line:
# nbtb validate notebook.ipynb
Requires Python 3.10 or later (supports up to 3.13).
Verify before relying
- Whether the 'punch' tool for exercise creation integrates with existing learning management systems or grading workflows.
- Performance characteristics when processing very large notebooks or batch operations on hundreds of files.
- Availability and completeness of programmatic API documentation beyond the command-line interface.
Package facts
| License | MIT License Copyright (c) 2017 - Eindhoven University of Technology, The Netherlands Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (<3.14,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — nbformat, nbconvert, jupyter-client, numpy, pandas |
| Maintenance | actively maintained — 105 days since the last release |
| First released | |
| Downloads | 201,848/month — #9,660 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: nbtoolbelt-2026.4.1-py3-none-any.whl
Keywords: Jupyter notebooks, software tools, education
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
nb-cleannb-clean removes execution counts, metadata,…
permissive · top 15,000 on PyPI
nbformatnbformat provides Python APIs and the reference…
permissive · top 1,000 on PyPI
pybatfishPybatfish is a Python client for Batfish, a…
permissive · top 15,000 on PyPI
nbconvertnbconvert converts Jupyter notebooks (.ipynb…
permissive · top 1,000 on PyPI
nbdevnbdev is a notebook-driven development platform…
permissive · top 15,000 on PyPI
nbqaRuns standard Python linters and formatters…
permissive · top 15,000 on PyPI
nbmakeA pytest plugin that executes Jupyter notebooks…
permissive · top 15,000 on PyPI
nbvalA pytest plugin that treats Jupyter notebooks…
permissive · top 15,000 on PyPI
nbclientnbclient executes Jupyter notebooks…
permissive · top 1,000 on PyPI
pyctProvides command-line and Python utilities for…
permissive · top 15,000 on PyPI