Registry / data / execnb

execnb

JSON →
library0.2.2pypypiunverified

A Python library for executing Jupyter notebooks in non-interactive environments. Supports capturing outputs, rendering inline plots, and running notebooks from the command line. Current version 0.2.2, released March 2024. Maintained by AnswerDotAI, release cadence irregular.

pip install execnb
INSTALL
IMPORT
SIG · EXECNB
E
execnb
datapythonv0.2.2
Install
4.9s avg
Import
—
Disk
73MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.2.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 81MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.9s · import 0.000s · 82MB
73MB installed
● package 73MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

exec_nb
✓ from execnb import exec_nb
✗ from execnb import exec_nb

Execute a Jupyter notebook file and iterate over cell outputs.

from execnb.nbio import exec_nb from pathlib import Path # Execute a notebook and capture outputs nb = exec_nb('notebook.ipynb') for cell in nb.cells: if cell.outputs: for output in cell.outputs: print(output.text if hasattr(output, 'text') else output)
execnb --version
Debug
Known issues
breakingThe nbio module was moved from execnb.nbio to fastcore.nbio in version 0.2.0. Code using old imports will break.
fix
Update imports to use execnb.nbio for exec_nb, read_nb, NBIO. If using fastcore.nbio directly, adjust accordingly.
affects: <0.2.0
deprecatedThe old exec_nb function without specifying mpl_format may set up inline matplotlib automatically, which can interfere with headless environments.
fix
Use mpl_format=None in exec_nb to skip matplotlib setup when not needed.
affects: <0.2.2
gotchaExecuting notebooks that use interactive widgets or require user input will fail. execnb is designed for non-interactive execution.
fix
Ensure notebooks are prepared for batch execution, avoiding input() calls or interactive widgets.
affects: all
gotchaCell IDs are not extracted from cell metadata automatically in versions prior to 0.1.17. This can cause duplicate or missing cell identifiers.
fix
Upgrade to >=0.1.17 or manually set cell IDs in the notebook metadata.
affects: <0.1.17
Upgrade
Version history
0.2.2latest on PyPI · released Apr 26, 2026
Audit
Dependencies
fastcorerequiredRequired for nbio module (moved from execnb in v0.2.0)
ipythonrequiredUsed for execution kernel and rich output
matplotliboptionalInline plotting support (optional if mpl_format=None)
Agent activity
18 hits · last 30 days
node
14
OpenAI (training)
1
Resources
execnb — pip install execnb · libregistry