Skip to main content
Ctrl+K

πŸ–ΌοΈ Sphinx-Gallery

  • User guide
  • Advanced
  • Demo galleries
  • Contribution Guide
  • Changelog
  • GitHub
  • PyPI
  • User guide
  • Advanced
  • Demo galleries
  • Contribution Guide
  • Changelog
  • GitHub
  • PyPI

Sphinx-Gallery#

A Sphinx extension that builds an HTML gallery of examples from any set of Python scripts. Check out the documentation for introductions on how to use it and more…

Features#

  • πŸš€ Create example galleries automatically by running pure Python example scripts while capturing outputs + figures, rendering them into reST files built into your documentation by Sphinx:

  • πŸ“ Embed reST in your example Python files, allowing you to interweave narrative-like content with code that generates plots in your documentation. Sphinx-Gallery also automatically generates a Jupyter Notebook for each your example page.

  • πŸ“‹ Add mini-galleries for API documentation. Sphinx-Gallery can generate mini-galleries listing all examples that use a particular function/method/etc.

  • πŸ”— Add intersphinx links to your examples. Sphinx-Gallery can automatically add links to API documentation for functions/methods/classes that are used in your examples (for any Python module that uses intersphinx).

  • πŸ—’οΈ Manage multiple galleries to create and embed galleries for several folders of examples.

Installation#

You can do a direct install via pip by using:

$ pip install sphinx-gallery

Tip

Sphinx-Gallery also has support for scraping images from Matplotlib and Matplotlib-based packages such as Seaborn. We recommend installing system optipng binaries to reduce the file sizes of the generated PNG files.

How to cite#

If you would like to cite Sphinx-Gallery you can do so using our Zenodo deposit.

Contribute#

Thank you for your interest! Please see our

contributing guide to get started.

next

Using Sphinx-Gallery

On this page
  • Features
  • Installation
  • How to cite
  • Contribute

Β© Copyright 2014-2025, Sphinx-gallery developers.

Created using Sphinx 8.1.3.

Built with the PyData Sphinx Theme 0.16.1.