accessible-pygments
A collection of accessible pygments styles
What it is and what it does
accessible-pygments is a theme package for Pygments that bundles multiple syntax highlighting color schemes designed to meet WCAG 2.1 accessibility standards. It provides themes at both AAA (highest contrast) and AA (standard contrast) compliance levels, with several variants optimized for color-blind users. The package integrates directly with Pygments' HtmlFormatter and works as a Sphinx documentation plugin, allowing developers to apply accessible color schemes to code blocks in documentation, websites, and applications without writing custom CSS or color definitions.
The package includes themes derived from established open-source projects like GitHub's VSCode themes, pitaya-smoothie, and others, all validated for color contrast ratios. It's designed for developers building documentation systems, technical blogs, or code-heavy applications who need to ensure their syntax highlighting meets accessibility standards without manual color tuning.
Use it for:
- Apply WCAG-compliant syntax highlighting to Sphinx documentation by setting pygments_style in conf.py.
- Highlight code snippets in web applications with guaranteed color contrast for users with low vision.
- Use color-blind friendly themes when building documentation or tools for diverse audiences.
- Replace default Pygments themes with accessible alternatives in existing code formatters.
- Ensure code examples in educational materials meet accessibility standards for all learners.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a collection of WCAG 2.1-compliant syntax highlighting themes for Pygments, including color-blind friendly variants for use in code documentation and applications.
Yes. If you use Pygments for code highlighting and need WCAG 2.1 compliance, this package eliminates the need to design and validate color schemes yourself. Low install friction, no known vulnerabilities, permissive license, and active maintenance make it a straightforward addition to documentation or web projects. Skip it only if you have custom color requirements or don't need accessibility compliance.
Install
accessible-pygments on PyPI
pip
pip install accessible-pygmentsuv
uv add accessible-pygmentspoetry
poetry add accessible-pygmentsInstalling accessible-pygments
Before you install
Low friction install with a single runtime dependency on pygments. Actively maintained with recent commits; development status is Alpha but the package has been stable since its first release in 2022.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute this package freely in both open-source and proprietary projects with minimal restrictions.
Quickstart
pip install accessible-pygments
from pygments.formatters import HtmlFormatter
formatter = HtmlFormatter(style='a11y-light')
# Use formatter to highlight code with accessible theme
Requires pygments to be installed; Pygments handles the actual syntax highlighting.
Verify before relying
- Whether all listed themes are fully tested for WCAG 2.1 compliance across all code language types.
- Performance characteristics when rendering large code blocks with these themes.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pygments |
| Maintenance | actively maintained — 826 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,362,983/month — #2,113 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: accessible_pygments-0.0.5-py3-none-any.whl
Keywords: Sphinx, WCAG, a11y, accessibility, pygments
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pygments-stylesProvides a curated collection of Pygments…
permissive · top 15,000 on PyPI
jupyterlab-pygmentsProvides a Pygments syntax highlighting theme…
permissive · top 1,000 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
ansible-pygmentsProvides a Pygments lexer and style for…
permissive · top 15,000 on PyPI
ipython-pygments-lexersProvides Pygments syntax highlighters for…
permissive · top 1,000 on PyPI
fluent.pygmentsAdds syntax highlighting support for Fluent…
permissive · top 15,000 on PyPI
Pallets-Sphinx-ThemesProvides Sphinx themes styled for Pallets…
permissive · top 15,000 on PyPI
sphinx-rtd-dark-modeAdds a toggleable dark mode interface to Sphinx…
permissive · top 15,000 on PyPI
types-PygmentsProvides type hints for the Pygments syntax…
permissive · top 5,000 on PyPI
sphinx-immaterialA Sphinx documentation theme that adapts the…
permissive · top 15,000 on PyPI