--- id: types-bleach version: "6.4.0.20260728" license: Apache-2.0 license_treatment: permissive maintenance: active --- # types-bleach — Typing stubs for bleach License: permissive · Maintenance: active · Downloads: 1.8M/mo ## What it is and what it does types-bleach is a type stub package that provides static type information for the bleach HTML sanitization library. It allows type checkers like mypy, pyright, and ty to understand and validate code that calls bleach functions, catching type errors at development time rather than runtime. The stubs are maintained as part of the typeshed project and are generated from the official typeshed repository. This package is a pure typing aid—it contains no runtime code and does not replace bleach itself. It is useful when you want strict type checking in projects that use bleach but do not want to add bleach as a direct dependency to your type-checking environment, or when bleach does not yet ship its own inline type hints. The package depends on types-html5lib to provide types for bleach's HTML parsing dependency. Use it for: - Add type checking to a project that uses bleach for HTML sanitization without installing bleach in your type-checking environment. - Validate bleach function calls and return types in a mypy or pyright configuration before runtime. - Ensure type safety when passing user input through bleach.clean() or other bleach sanitization functions. - Integrate bleach into a strictly typed codebase that enforces type checking in CI/CD pipelines. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides type stubs for the bleach HTML sanitization library, enabling static type checkers to validate code that uses bleach without requiring the library itself to be installed. Yes, if you use bleach and want static type checking. Install it alongside your type checker (mypy, pyright, or ty) in development or CI environments. The package is lightweight, actively maintained, has no known vulnerabilities, and carries a permissive license. It is only useful if you are already using a static type checker; it adds no runtime value. ## Install pip install types-bleach uv add types-bleach poetry add types-bleach ## Installing types-bleach Before you install: Low friction installation with a single runtime dependency on types-html5lib. The package is actively maintained with a recent release and no known vulnerabilities. License in practice: Licensed under Apache-2.0 (permissive), allowing use in most commercial and open-source projects without significant restrictions. Quickstart: pip install types-bleach # In your code, type checkers will now understand bleach imports: import bleach result: str = bleach.clean('

Hello

') Requires Python 3.10 or later; type stubs are only useful when used with a type checker like mypy, pyright, or ty. Verify before relying: - Whether the stubs cover all bleach 6.4.* APIs or only a subset of the public surface. - Whether installing this package is necessary or if bleach itself now ships inline type hints. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags type stubs for bleach, bleach type hints, static type checking bleach, mypy bleach annotations, bleach typing support, pyright bleach stubs, bleach type annotations, type-stubs, static-analysis [View on SkillFed](https://skillfed.io/packages/types-bleach) · [View on PyPI](https://pypi.org/project/types-bleach/)