sphinx-gallery
A Sphinx extension that builds an HTML gallery of examples from any set of Python scripts.
Decision gist · record as of 2026-08-14
Yes. Sphinx-Gallery is a mature, actively maintained tool with low install friction and no known vulnerabilities. It solves a concrete problem—turning Python scripts into documented, executable galleries—and is widely adopted by major projects. Install it if you need to showcase runnable examples in Sphinx documentation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Sphinx and pillow as runtime dependencies; Python 3.10 or later.
- Low friction: pure Python wheel with only two runtime dependencies (pillow and sphinx).
- Actively maintained as of 2026-04-24 with recent activity, supporting current Python versions (3.10–3.14).
License · maintenance · safety
3-clause BSD (permissive) — 3-clause BSD is permissive; you can use, modify, and distribute sphinx-gallery freely in commercial and private projects with minimal restrictions.
last release 2026-04-24 (112 days) · last repo commit 2026-08-14 · 454 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 650,798 downloads/mo, #5,556 on PyPI
Alternatives
Verify before relying
pip install sphinx-gallery
# In doc/conf.py:
extensions = ['sphinx_gallery.gen_gallery']
sphinx_gallery_conf = {
'examples_dirs': '../examples',
'gallery_dirs': 'auto_examples',
}- Whether optional system binaries (optipng) are required or merely recommended for PNG optimization.
- Performance characteristics when processing large numbers of example scripts or high-resolution images.
What it is and what it does
Sphinx-Gallery is a Sphinx extension that transforms a directory of Python example scripts into an interactive HTML gallery embedded in your documentation. It executes each script, captures outputs (including plots from Matplotlib and related packages), and generates formatted gallery pages with the code, results, and narrative text from docstrings or accompanying README files.
You configure it in your Sphinx conf.py by specifying the source directory of example scripts and the output directory for generated gallery files. Sphinx-Gallery then handles execution, output capture, and reST file generation during your normal Sphinx build. It's designed for library documentation but can also serve as a standalone showcase for a Python package or module.
Use it for
- Build an interactive example gallery for a scientific Python library (like scikit-learn or Matplotlib) to demonstrate typical usage patterns.
- Generate a gallery of tutorials or how-to guides from executable Python scripts as part of your project documentation.
- Showcase data analysis workflows or computational examples with live output and visualizations in a web-accessible format.
- Create a portfolio or cookbook of example code snippets with their results for educational or reference purposes.
- Automatically keep example outputs in sync with code changes by re-executing scripts during documentation builds.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Sphinx-Gallery is a mature, actively maintained tool with low install friction and no known vulnerabilities. It solves a concrete problem—turning Python scripts into documented, executable galleries—and is widely adopted by major projects. Install it if you need to showcase runnable examples in Sphinx documentation.
Install
sphinx-gallery on PyPI
Before you install
Low friction: pure Python wheel with only two runtime dependencies (pillow and sphinx). Actively maintained as of 2026-04-24 with recent activity, supporting current Python versions (3.10–3.14).
Requires Sphinx and pillow as runtime dependencies; Python 3.10 or later.
License in practice
3-clause BSD is permissive; you can use, modify, and distribute sphinx-gallery freely in commercial and private projects with minimal restrictions.
Quickstart
pip install sphinx-gallery
# In doc/conf.py:
extensions = ['sphinx_gallery.gen_gallery']
sphinx_gallery_conf = {
'examples_dirs': '../examples',
'gallery_dirs': 'auto_examples',
}
Verify before relying
- Whether optional system binaries (optipng) are required or merely recommended for PNG optimization.
- Performance characteristics when processing large numbers of example scripts or high-resolution images.
Package facts
| License | 3-clause BSD permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespillowsphinx |
| Maintenance | Actively maintained 112 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 650,798 / month, #5,556 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaFramework :: Sphinx :: ExtensionIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: sphinx_gallery-0.21.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sphinx documentation gallery generator”
- sphinx-gallerySphinx-Gallery is a Sphinx extension that automatically generates…
- SphinxSphinx generates professional documentation from reStructuredText…
- sphinxcontrib-devhelpA Sphinx extension that generates Devhelp documentation output…
Give your agent the search over MCP, or paste the wish link into any chat.
More Sphinx packages
Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.
Install it if you need to programmatically read and extract structured data from Python docstrings.
Sphinx generates professional documentation from reStructuredText source files, producing HTML, PDF, EPUB, and other formats with automatic cross-references, code highlighting, and hierarchical navigation.
A Sphinx extension that outputs documentation in serialized HTML formats (JSON and pickle) alongside standard HTML.
Alabaster is a clean, responsive Sphinx theme for documentation that requires Python 3.10 or newer and Sphinx 6.2 or newer.
A Sphinx extension that generates HTML help files from reStructuredText documentation source.
A Sphinx extension that converts documentation source files into QtHelp format, enabling integration with Qt-based help systems and documentation viewers.
However, be aware that maintenance is dormant—if you rely on it long-term, monitor Sphinx compatibility and consider whether QtHelp remains the right format for your…
See also sphinx-click · sphinx-jinja · sphinx-tabs · sphinx-markdown-builder · autodocsumm · sphinx-favicon · sphinx-markdown-tables · sphinx-llm · nbsphinx · sphinxcontrib-django