Pygments
Pygments is a syntax highlighting package written in Python.
Decision gist · record as of 2026-08-14
Yes. Pygments is a top-100 PyPI package with no known vulnerabilities, zero runtime dependencies, permissive licensing, and active maintenance. It solves a well-defined problem with broad language support and multiple output formats. Install it if you need to display or transform source code.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation is straightforward with no runtime dependencies.
- The package is actively maintained with recent commits and has been stable since its first release, supporting current Python versions 3.9 through 3.14.
License · maintenance · safety
BSD-2-Clause (permissive) — Pygments is licensed under BSD-2-Clause (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2026-03-29 (138 days) · last repo commit 2026-07-28 · 2,198 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,270,057,742 downloads/mo, #14 on PyPI
Alternatives
Verify before relying
pip install pygments
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter
code = 'print("hello")'
result = highlight(code, PythonLexer(), HtmlFormatter())- Whether PIL/Pillow is required as an optional dependency for image format output
What it is and what it does
Pygments is a mature, widely-used syntax highlighter written in pure Python. It recognizes over 500 programming languages and text formats, then transforms source code into colorized output suitable for display in web pages, documents, terminals, or images. The package works both as a library and as a command-line tool for one-off highlighting tasks.
It has no required runtime dependencies, making installation and integration straightforward. The core strength is its extensive language support and multiple output formats—HTML for web embedding, LaTeX for PDF documents, ANSI sequences for terminal display, and image formats. It is actively maintained, supports Python 3.9 and newer, and has been in production since 2006.
Use it for
- Embed syntax-highlighted code snippets in static site generators or documentation tools
- Add color to source code displayed in web forums, issue trackers, or code review systems
- Generate highlighted code blocks for PDF or LaTeX documents in technical publishing
- Display colorized terminal output for CLI tools, REPLs, or log viewers
- Prettify code in wikis or collaborative documentation platforms
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Pygments is a top-100 PyPI package with no known vulnerabilities, zero runtime dependencies, permissive licensing, and active maintenance. It solves a well-defined problem with broad language support and multiple output formats. Install it if you need to display or transform source code.
Install
pygments on PyPI
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with recent commits and has been stable since its first release, supporting current Python versions 3.9 through 3.14.
License in practice
Pygments is licensed under BSD-2-Clause (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install pygments
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter
code = 'print("hello")'
result = highlight(code, PythonLexer(), HtmlFormatter())
Verify before relying
- Whether PIL/Pillow is required as an optional dependency for image format output
Package facts
| License | BSD-2-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 138 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,270,057,742 / month, #14 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 6 - MatureIntended Audience :: DevelopersIntended Audience :: End Users/DesktopIntended Audience :: System AdministratorsOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Text Processing :: FiltersTopic :: Utilities |
Evidence: pygments-2.20.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 › “code colorization”
- PygmentsPygments is a syntax highlighter that colorizes source code and text…
- click-extraClick Extra is a wrapper around Click that adds configuration file…
- coloredlogsAdds colored output to Python's standard logging module using ANSI…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also ipython-pygments-lexers · pygments-styles · fluent.pygments · ansible-pygments · jupyterlab-pygments · accessible-pygments · pygmars · types-Pygments · pyvim · pygount