skillfed

execnb

A description of your project

execnb v0.3.2 103.2K downloads/30d#12,820 on PyPI137
Permissive license Apache-2.0 Active released

What it is and what it does

Execnb is a library for executing Jupyter notebook code outside a running Jupyter server. It provides CaptureShell, an async interface that runs notebook cells and captures their outputs in the standard Jupyter output format, without requiring Jupyter to be installed or running. This is useful for automating notebook execution, batch processing, or integrating notebook code into larger applications.

The package depends on fastcore and ipython, and offers both a programmatic async API and a command-line tool (exec_nb) for executing and saving notebooks with outputs. It's in pre-alpha status but actively maintained, with support for modern Python versions.

Use it for:

  • Batch execute multiple notebooks and save results with outputs filled in.
  • Integrate notebook execution into CI/CD pipelines or automated testing workflows.
  • Run notebook code from a regular Python script or application without a Jupyter server.
  • Programmatically inject code into notebooks before execution for parameterization.
  • Generate documentation by executing and capturing outputs from example notebooks.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Executes Jupyter notebook code and captures outputs without running a Jupyter server, via an async API or command-line tool.

Yes, if you need to execute notebooks programmatically or in automation. The low install friction, active maintenance, permissive license, and lack of known vulnerabilities make it a safe choice. Pre-alpha status means the API may change, so pin the version if stability is critical.

Install

execnb on PyPI

pip

pip install execnb

uv

uv add execnb

poetry

poetry add execnb

Installing execnb

Before you install

Low install friction with only two runtime dependencies (fastcore and ipython). Active maintenance with a recent release (4 days ago) and steady repository activity.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects.

Quickstart

pip install execnb

from execnb.shell import CaptureShell
import asyncio

s = CaptureShell()
result = asyncio.run(s.run('1+1'))
print(result)

Requires Python 3.7 or later; async API requires either an async context (notebook/async code) or wrapping in asyncio.run() at sync entry points.

Verify before relying

  • Whether CaptureShell handles all Jupyter magic commands and cell types correctly.
  • Performance characteristics when executing large or long-running notebooks.
  • Compatibility with specific notebook features (widgets, display objects, etc.).

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — fastcore, ipython
Maintenance actively maintained — 4 days since the last release
Last repo commit
First released
Downloads 103,231/month — #12,820 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: execnb-0.3.2-py3-none-any.whl

Keywords: some, keywords

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Tags

run jupyter notebooks without serverexecute notebook cells programmaticallycapture notebook output asyncnotebook execution engineautomated notebook runnerjupyter code execution librarynotebook batch processing
notebook-executionjupyter-automationasync-api

More Software Development packages