skillfed

types-beautifulsoup4

Typing stubs for beautifulsoup4

types-beautifulsoup4 v4.12.0.20250516 5.7M downloads/30d#2,061 on PyPI37
Permissive license Apache-2.0 Active released

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-beautifulsoup4

uv

uv add types-beautifulsoup4

poetry

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 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

Programming Language :: Python :: 3Typing :: Stubs Only

Tags

beautifulsoup4 type hintsbeautifulsoup4 type stubstype checking html parsingpep 561 stubs beautifulsoupstatic type checking web scrapingbeautifulsoup4 annotationshtml parsing type safety
type-stubstypeshed

More HTML packages