ansible-pygments
Tools for building the Ansible Distribution
What it is and what it does
ansible-pygments is a Pygments plugin that adds syntax highlighting support for Ansible command output and a matching color scheme. It registers a lexer named `ansible-output` that recognizes Ansible's structured output format and applies semantic coloring. The package is designed to integrate with any tool that uses Pygments for code highlighting.
You install it alongside pygments, then reference the `ansible-output` lexer by name in code blocks or use the `ansible` style in configuration. It depends only on pygments and supports Python 3.9 through 3.13.
Use it for:
- Highlight Ansible playbook output examples in documentation with semantic color coding.
- Format Ansible command logs in technical runbooks for better readability.
- Style Ansible output in code snippets embedded in web pages or markdown rendered by pygments.
- Improve visibility of Ansible warnings and errors in generated operations documentation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Pygments lexer and style for syntax-highlighting Ansible output, registered globally as `ansible-output` for use in any tool that integrates Pygments.
Yes, if you use pygments-based tools to document or display Ansible output. It is actively maintained, has no security issues, and adds a single lightweight dependency. Not necessary if you do not use Pygments-integrated documentation or do not need Ansible-specific highlighting.
Install
ansible-pygments on PyPI
pip
pip install ansible-pygmentsuv
uv add ansible-pygmentspoetry
poetry add ansible-pygmentsInstalling ansible-pygments
Before you install
Low install friction with a single runtime dependency on pygments. Actively maintained with recent commits and no known vulnerabilities.
License in practice
BSD-2-Clause is permissive; you can use this in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install ansible-pygments pygments
import pygments
from pygments.lexers import get_lexer_by_name
lexer = get_lexer_by_name('ansible-output')
Requires Python 3.9 or later.
Verify before relying
- Whether the lexer handles all Ansible output formats (warnings, errors, variable dumps) beyond documented examples.
- Performance characteristics when highlighting large Ansible logs or output blocks.
- Full integration steps with documentation tools beyond the description excerpt provided.
Package facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.9.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pygments |
| Maintenance | actively maintained — 405 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 159,912/month — #10,682 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ansible_pygments-0.1.2-py3-none-any.whl
Tags
More Documentation packages
Docutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
griffeGriffe extracts the complete structure and…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
ipython-pygments-lexersProvides Pygments syntax highlighters for…
permissive · top 1,000 on PyPI
pygments-stylesProvides a curated collection of Pygments…
permissive · top 15,000 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
fluent.pygmentsAdds syntax highlighting support for Fluent…
permissive · top 15,000 on PyPI
accessible-pygmentsProvides a collection of WCAG 2.1-compliant…
permissive · top 5,000 on PyPI
antsibull-docsBuilds and generates Ansible documentation from…
copyleft · top 15,000 on PyPI
rich-argparseFormats argparse and optparse help output with…
permissive · top 1,000 on PyPI
jupyterlab-pygmentsProvides a Pygments syntax highlighting theme…
permissive · top 1,000 on PyPI
antsibull-docs-parserA Python library for parsing and processing…
copyleft · top 15,000 on PyPI
pygmarsPygmars builds lightweight lexers and parsers…
permissive · top 15,000 on PyPI