--- id: types-beautifulsoup4 version: "4.12.0.20250516" license: Apache-2.0 license_treatment: permissive maintenance: active --- # types-beautifulsoup4 — Typing stubs for beautifulsoup4 License: permissive · Maintenance: active · Downloads: 5.7M/mo ## 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 above — 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 pip install types-beautifulsoup4 uv add types-beautifulsoup4 poetry add types-beautifulsoup4 ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 5.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags beautifulsoup4 type hints, beautifulsoup4 type stubs, type checking html parsing, pep 561 stubs beautifulsoup, static type checking web scraping, beautifulsoup4 annotations, html parsing type safety, type-stubs, typeshed [View on SkillFed](https://skillfed.io/packages/types-beautifulsoup4) · [View on PyPI](https://pypi.org/project/types-beautifulsoup4/)