types-html5lib
Typing stubs for html5lib
What it is and what it does
types-html5lib is a type stub package that bridges the gap between the html5lib HTML parser and static type checkers. It provides type annotations for html5lib's public API, allowing mypy, pyright, and other type checkers to validate code that uses html5lib without runtime overhead. The stubs are maintained as part of the typeshed project and are tested against current versions of major type checkers.
When installed alongside html5lib, this package enables developers to catch type-related bugs during development rather than at runtime. It targets html5lib version 1.1.x and requires Python 3.10 or later. The package has a single runtime dependency (types-webencodings) and is distributed as a pure wheel, making installation straightforward.
Use it for:
- Enable mypy or pyright to type-check code that parses HTML with html5lib in a CI/CD pipeline.
- Develop HTML parsing applications with IDE autocomplete and type hints for html5lib methods and classes.
- Validate type safety in projects that combine html5lib with other typed libraries in a large codebase.
- Ensure compatibility between html5lib usage and strict type-checking configurations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type hints for the html5lib HTML parser, enabling static type checkers like mypy and pyright to validate code that uses html5lib.
Yes, if you use html5lib and run static type checking. It has no runtime cost, low install friction, and is actively maintained as part of typeshed. If you don't use a type checker or don't use html5lib, it provides no value. Apache-2.0 licensing poses no restrictions.
Install
types-html5lib on PyPI
pip
pip install types-html5libuv
uv add types-html5libpoetry
poetry add types-html5libInstalling types-html5lib
Before you install
Low install friction; a pure-Python wheel with a single lightweight runtime dependency (types-webencodings). Maintained actively as part of the typeshed project with recent commits.
License in practice
Apache-2.0 permissive license allows use in most projects without restriction; suitable for both open-source and commercial work.
Quickstart
pip install types-html5lib
# In your code, import html5lib normally; type checkers will use the stubs
import html5lib
parser = html5lib.HTMLParser()
doc = parser.parse("<html></html>")
Requires Python 3.10 or later; only provides type information, not runtime functionality—html5lib itself must be installed separately.
Verify before relying
- Coverage of html5lib 1.1.x API surface completeness beyond the tested type checkers (mypy 2.1.0, pyright 1.1.409).
- Whether stubs remain synchronized with html5lib releases after the typeshed commit date.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — types-webencodings |
| Maintenance | actively maintained — 88 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,191,646/month — #1,472 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_html5lib-1.1.11.20260518-py3-none-any.whl
Tags
More HTML packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
lxmllxml provides Python bindings to libxml2 and…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
MarkdownConverts Markdown text to HTML using a Python…
permissive · top 1,000 on PyPI
types-aiofilesProvides type hints for the aiofiles async file…
permissive · top 5,000 on PyPI
types-python-http-clientProvides type hints for python-http-client,…
permissive · top 15,000 on PyPI
types-tomlProvides type hints for the toml package,…
permissive · top 1,000 on PyPI
types-uWSGIProvides type hints for the uWSGI Python API,…
permissive · top 15,000 on PyPI
types-xlrdProvides type hints for the xlrd library,…
permissive · top 15,000 on PyPI
types-zxcvbnProvides type hints for the zxcvbn password…
permissive · top 15,000 on PyPI
types-webencodingsProvides type hints for the webencodings…
permissive · top 5,000 on PyPI
types-jsonschemaProvides type hints for the jsonschema package,…
permissive · top 5,000 on PyPI
types-chevronProvides type hints for the chevron Mustache…
permissive · top 15,000 on PyPI
types-defusedxmlProvides type hints for the defusedxml library,…
permissive · top 5,000 on PyPI