# pygments/pygments

Pygments is a generic syntax highlighter written in Python

Repository: https://github.com/pygments/pygments
Canonical: https://ross.abutalabs.com/products/pygments
Homepage: http://pygments.org/
Language: Python
License: BSD-2-Clause
License Family: permissive
Topics: python, syntax-highlighting
Last push: 2026-08-17T08:03:32+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 74, longevity 100
- inputs: {"age_days": 2559, "days_push": 16, "days_rel": 16, "gap_med": 152.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2204, forks 867 (observed 2026-08-28T04:06:25.923712+00:00)

## What it is
Pygments is a generic syntax highlighter written in Python that supports over 600 languages and text formats. It can be used both as a Python library and as a command-line tool (pygmentize), producing output in formats such as HTML, ANSI terminal sequences, LaTeX, and RTF.

## Use cases
- highlight source code in a forum or wiki
- render code snippets as HTML for a blog
- colorize code in the terminal with ANSI output
- add syntax highlighting to a code hosting site
- generate LaTeX listings with highlighted code
- highlight user-submitted code in a web application
- find the language of a code snippet

## When to choose
- you need syntax highlighting for many languages in a Python project
- you want a mature, dependency-free highlighting library with a CLI
- you need multiple output formats like HTML, LaTeX, RTF, or ANSI
- you want to add custom lexers or styles via a plugin mechanism

## When to avoid
- you need guaranteed bounded execution time on untrusted input (DoS risk from catastrophic regex backtracking)
- you need a full parser or compiler front-end rather than approximate highlighting
- you need highlighting in a non-Python runtime without calling out to Python

## Facets
- artifact type: library
- maturity: stable
- function: parser, templating, cli, developer-tools
- domain: developer-tools, web-development, documentation, programming-languages
- platform: python, cli, cross-platform
- tags: syntax-highlighting, lexers, formatters, code-prettify, ansi-terminal, html-output

## Member repositories
- pygments/pygments (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:25.923712+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:46:44.031313+00:00, confidence not recorded.
  - readme: https://github.com/pygments/pygments (fetched 2026-08-28T04:06:25.923712+00:00, sha 10ff916d42c2)
  - homepage: http://pygments.org/ (fetched 2026-08-29T10:27:01.487102+00:00, sha df70057cbb60)
  - site_page: https://pygments.org/docs (fetched 2026-08-29T10:27:01.493094+00:00, sha 3a35406d2109)
  - site_page: https://pygments.org/docs/changelog (fetched 2026-08-29T10:27:01.494845+00:00, sha a0bec346093b)
  - site_page: https://pygments.org/docs/contributing (fetched 2026-08-29T10:27:01.499049+00:00, sha 5eabc6b82994)
  - registry_pypi: https://pypi.org/pypi/pygments/json (fetched 2026-08-29T10:27:01.500748+00:00, sha 6cdc779a132b)
  - site_page: https://pygments.org/faq (fetched 2026-08-29T10:27:01.490932+00:00, sha a4c708e869a5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
