types-Pygments
Typing stubs for Pygments
Decision gist · record as of 2026-08-14
Yes, if you use Pygments and run a static type checker. It has no runtime cost, no dependencies, and is actively maintained by typeshed. Install it alongside Pygments to enable type checking. If you do not use a type checker or do not use Pygments, it provides no value.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low install friction with no runtime dependencies.
- Actively maintained as part of typeshed, with a release 17 days old and recent upstream commits.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), imposing no restrictions on use or distribution.
last release 2026-07-28 (17 days) · last repo commit 2026-08-14 · 37 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,201,764 downloads/mo, #2,704 on PyPI
Alternatives
Verify before relying
pip install types-Pygments
import pygments
from pygments.lexers import get_lexer_by_name
lexer = get_lexer_by_name('python')- Whether coverage of Pygments 2.20.* APIs is sufficient for your specific use case, given the package is marked as partial.
- Compatibility with type checkers beyond mypy 2.3.0, pyright 1.1.411, and ty 0.0.59.
What it is and what it does
types-Pygments is a type stub package that adds static type annotations for the Pygments syntax highlighting library. It allows type checkers like mypy and pyright to understand and validate code that imports and uses Pygments, catching type-related errors at check time rather than runtime.
The package is maintained as part of typeshed, the canonical repository of type stubs for the Python ecosystem. It targets Pygments 2.20.* and is marked as partial, meaning some annotations may be incomplete—contributions to improve coverage are welcomed through the typeshed project itself.
Use it for
- Enable mypy or pyright to type-check code that uses Pygments for syntax highlighting.
- Catch type errors in Pygments API calls during static analysis before running code.
- Provide IDE autocomplete and inline type information for Pygments functions and classes.
- Integrate Pygments into a codebase with strict type checking enabled.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use Pygments and run a static type checker.
It has no runtime cost, no dependencies, and is actively maintained by typeshed. Install it alongside Pygments to enable type checking. If you do not use a type checker or do not use Pygments, it provides no value.
Install
types-pygments on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as part of typeshed, with a release 17 days old and recent upstream commits.
Requires Python 3.10 or later.
License in practice
Licensed under Apache-2.0 (permissive), imposing no restrictions on use or distribution.
Quickstart
pip install types-Pygments
import pygments
from pygments.lexers import get_lexer_by_name
lexer = get_lexer_by_name('python')
Verify before relying
- Whether coverage of Pygments 2.20.* APIs is sufficient for your specific use case, given the package is marked as partial.
- Compatibility with type checkers beyond mypy 2.3.0, pyright 1.1.411, and ty 0.0.59.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,201,764 / month, #2,704 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Typing :: Stubs Only |
Evidence: types_pygments-2.20.0.20260728-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 › “type stubs pygments”
- types-PygmentsProvides type hints for the Pygments syntax highlighting library,…
- typecodeDetects file types and MIME types using libmagic and Pygments, with…
- jupyterlab-pygmentsProvides a Pygments syntax highlighting theme that applies…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also types-peewee · types-tensorflow · types-yt-dlp · types-pyinstaller · types-grpcio · types-docutils · types-braintree · types-lxml · types-openpyxl · Pygments