skillfed

nbsphinx

Jupyter Notebook Tools for Sphinx

nbsphinx v0.9.8 1.9M downloads/30d#3,438 on PyPI472
Permissive license MIT Active released

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 nbsphinx

uv

uv add nbsphinx

poetry

poetry add nbsphinx

Installing 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

Framework :: JupyterFramework :: SphinxFramework :: Sphinx :: ExtensionIntended Audience :: EducationIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Documentation :: Sphinx

Tags

jupyter notebook sphinx documentationsphinx ipynb parserinclude jupyter notebooks in sphinx docsnotebook to sphinx htmlsphinx jupyter integrationdocument jupyter code cellssphinx notebook extension
jupyter-integrationdocumentation-generation

More Sphinx packages