types-beautifulsoup4
Typing stubs for beautifulsoup4
What it is and what it does
types-beautifulsoup4 is a PEP 561 type stub package that adds static type information to beautifulsoup4, allowing type checkers to understand and validate code that uses beautifulsoup4. It's part of the typeshed project and targets beautifulsoup4 version 4.12.*.
The package is marked as partial, meaning some type annotations may be incomplete or missing. It's designed as a bridge for users of beautifulsoup4 4.12 who want type-checking support; users of beautifulsoup4 4.13.0 or later should uninstall this package since those versions include built-in type annotations.
Use it for:
- Enable type checkers to validate web scraping code that uses beautifulsoup4 4.12
- Catch type errors in HTML parsing logic before runtime in a CI/CD pipeline
- Provide IDE autocomplete and type hints for BeautifulSoup objects in development
- Validate code that chains beautifulsoup4 method calls for correctness
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type hints for beautifulsoup4 code via PEP 561 stubs, enabling static type checkers to validate code that uses beautifulsoup4.
Yes, if you use beautifulsoup4 4.12.* and want static type checking. Install only if your project targets beautifulsoup4 4.12; uninstall if you upgrade to 4.13.0 or later, which includes native type annotations. No security vulnerabilities and low install friction make it a safe addition to type-checking workflows.
Install
types-beautifulsoup4 on PyPI
pip
pip install types-beautifulsoup4uv
uv add types-beautifulsoup4poetry
poetry add types-beautifulsoup4Installing types-beautifulsoup4
Before you install
Low friction; a pure-Python stub package with a single runtime dependency on types-html5lib. Actively maintained as part of typeshed, with recent releases tracking beautifulsoup4 4.12.* versions.
License in practice
Apache-2.0 permissive license allows free use, modification, and distribution with minimal restrictions, making it safe to include in most projects.
Quickstart
pip install types-beautifulsoup4
# Type checker now understands beautifulsoup4 types when checking your code
Requires beautifulsoup4 to be installed separately; intended for beautifulsoup4 versions 4.12.* only. beautifulsoup4 4.13.0+ includes its own type annotations, making this package redundant for newer versions.
Verify before relying
- Whether the stub package remains compatible with beautifulsoup4 4.12.x releases beyond the latest tested version
- Coverage completeness of type annotations relative to beautifulsoup4's full API surface
- Which type checkers (mypy, pyright, pytype, Pyre, PyCharm) are actively tested against this version
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — types-html5lib |
| Maintenance | actively maintained — 455 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,656,880/month — #2,061 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_beautifulsoup4-4.12.0.20250516-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-PillowProvides type stubs for Pillow, enabling static…
permissive · top 5,000 on PyPI
types-urllib3Provides type stubs for urllib3 to enable…
permissive · top 1,000 on PyPI
docutils-stubsProvides PEP 561 type stubs for docutils,…
permissive · top 15,000 on PyPI
typeapiProvides a unified API for reflecting and…
permissive · top 15,000 on PyPI
types-SQLAlchemyProvides PEP 561 type stubs for SQLAlchemy,…
permissive · top 15,000 on PyPI
types-DateTimeRangeProvides type stubs for the DateTimeRange…
permissive · top 15,000 on PyPI
types-pyOpenSSLProvides type stubs for pyOpenSSL to enable…
permissive · top 5,000 on PyPI
types-botoProvides type stubs for the boto AWS SDK,…
permissive · top 15,000 on PyPI
typeshed-clientRetrieves stub file paths, AST nodes, and…
permissive · top 5,000 on PyPI
construct-typingAdds type hints and static type checking…
permissive · top 5,000 on PyPI