nbsphinx
Jupyter Notebook Tools for Sphinx
What it is and what it does
nbsphinx bridges Jupyter Notebooks and Sphinx documentation by treating .ipynb files as native Sphinx source. When you add notebook filenames to your Sphinx toctree, the extension parses them, renders code cells and outputs as documentation, and automatically executes any notebooks that lack stored output. This lets you write executable examples or tutorials as Jupyter Notebooks and have them appear seamlessly in your Sphinx-built HTML or LaTeX docs.
The package depends on nbconvert and nbformat to handle notebook I/O, sphinx for the documentation framework, and supporting libraries (docutils, jinja2, traitlets) for rendering and configuration. It's designed for technical documentation, education, and research contexts where executable code examples are valuable.
Use it for:
- Include executable Jupyter tutorials or walkthroughs directly in Sphinx documentation without manual conversion.
- Build API documentation that interleaves narrative text with runnable code examples from notebooks.
- Create scientific or research documentation where computed results are embedded in the final HTML or PDF output.
- Maintain a single notebook source that serves both as a standalone Jupyter file and as part of your Sphinx docs.
- Automatically regenerate documentation output from notebooks during the build, keeping examples in sync with code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
nbsphinx is a Sphinx extension that parses Jupyter Notebook files (.ipynb) as documentation source, rendering notebook code cells and their outputs in Sphinx-generated HTML and LaTeX documentation, with automatic execution of unevaluated notebooks during the build.
Yes. nbsphinx is actively maintained, has low install friction, carries no security vulnerabilities, and solves a specific and well-defined problem: integrating Jupyter Notebooks into Sphinx documentation. Install it if you want to include executable notebooks or notebook-style examples in your Sphinx docs; skip it if your documentation doesn't use notebooks.
Install
nbsphinx on PyPI
pip
pip install nbsphinxuv
uv add nbsphinxpoetry
poetry add nbsphinxInstalling nbsphinx
Before you install
Low friction: pure Python wheel with six runtime dependencies. Actively maintained with a recent release (259 days ago) and steady commit activity.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install nbsphinx
Edit conf.py and add 'nbsphinx' to extensions:
extensions = ['nbsphinx']
Add notebook filenames to index.rst toctree:
.. toctree::
my_notebook.ipynb
Requires Python >= 3.8 and an existing Sphinx documentation project.
Verify before relying
- Whether automatic notebook execution during build requires specific Jupyter kernel or environment setup beyond the listed dependencies.
- Performance characteristics when building documentation with many or large notebooks.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — docutils, jinja2, nbconvert, nbformat, sphinx, traitlets |
| Maintenance | actively maintained — 259 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,913,540/month — #3,438 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: nbsphinx-0.9.8-py3-none-any.whl
Keywords: Sphinx, Jupyter, notebook
Tags
More Sphinx packages
Parses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
sphinxcontrib-qthelpA Sphinx extension that converts documentation…
permissive · top 1,000 on PyPI
myst-nbSphinx extension that parses and converts…
unclear · top 5,000 on PyPI
nbsphinx-linkA Sphinx extension that lets you include…
permissive · top 15,000 on PyPI
sphinx-jupyterbook-latexA Sphinx extension that adds LaTeX output…
permissive · top 15,000 on PyPI
nbdevnbdev is a notebook-driven development platform…
permissive · top 15,000 on PyPI
nbstripoutStrips output cells and metadata from Jupyter…
permissive · top 5,000 on PyPI
jupyter-sphinxJupyter Sphinx Extensions runs code embedded in…
unclear · top 15,000 on PyPI
ipynbnameReturns the filename or full path of the…
permissive · top 15,000 on PyPI
importnbimportnb lets you import Jupyter notebooks as…
permissive · top 15,000 on PyPI
nbvalA pytest plugin that treats Jupyter notebooks…
permissive · top 15,000 on PyPI
nbconvertnbconvert converts Jupyter notebooks (.ipynb…
permissive · top 1,000 on PyPI