PyData Sphinx Theme
The PyData Sphinx Theme is a clean, three-column, Bootstrap-based Sphinx theme designed for the PyData community. It provides a modern, responsive design with built-in light/dark mode toggling and extensive customization options via `html_theme_options`. Currently at version 0.17.0, the project maintains a regular release cadence, with new versions published frequently (typically monthly or upon significant feature additions/bug fixes).
Warnings
- gotcha New major versions of Sphinx may not be immediately supported. The PyData Sphinx Theme aims to support the latest Sphinx version that is older than 6 months. Using a very recent Sphinx release might lead to build issues until the theme is updated.
- breaking Version 0.16.x introduced significant changes, including an upgrade to Bootstrap 5 and the removal of jQuery. This may break custom CSS, JavaScript, or certain theme options that relied on previous versions of Bootstrap (4) or jQuery.
- gotcha Theme-specific options must be set within the `html_theme_options` dictionary in `conf.py`. Directly defining `html_` variables (e.g., `html_sidebars`, `html_theme_path`, `html_theme_config`) might conflict with or override the theme's internal logic, leading to unexpected layout or functionality.
Install
-
pip install pydata-sphinx-theme -
conda install pydata-sphinx-theme --channel conda-forge
Imports
- html_theme configuration
html_theme = "pydata_sphinx_theme"
Quickstart
# conf.py
import os
import sys
project = 'My Awesome Project'
copyright = '2026, My Team'
author = 'My Team'
release = '0.1'
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/my-org/my-project",
"icon": "fa-brands fa-github",
"type": "fontawesome",
}
],
"navbar_persistent": [], # Remove 'search' from persistent navbar
"show_prev_next": False,
"switcher": {
"version_match": "latest",
},
"footer_start": ["copyright"],
}
html_static_path = ['_static']
html_css_files = ['custom.css'] # Example for custom CSS