--- id: execnb version: "0.3.2" license: Apache-2.0 license_treatment: permissive maintenance: active --- # execnb — A description of your project License: permissive · Maintenance: active · Downloads: 103.2K/mo ## 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 above — 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 pip install execnb uv add execnb 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_current - Install friction: low - Maintenance: active - Downloads: 103.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags run jupyter notebooks without server, execute notebook cells programmatically, capture notebook output async, notebook execution engine, automated notebook runner, jupyter code execution library, notebook batch processing, notebook-execution, jupyter-automation, async-api [View on SkillFed](https://skillfed.io/packages/execnb) · [View on PyPI](https://pypi.org/project/execnb/)