types-defusedxml
Typing stubs for defusedxml
What it is and what it does
types-defusedxml is a type stub package that provides type annotations for the defusedxml library. It allows static type checkers like mypy (1.20.0) and pyright (1.1.408) to understand and validate code that uses defusedxml for secure XML processing. The stubs are maintained as part of the typeshed project and target defusedxml 0.7.* versions.
This package has no runtime dependencies and is purely for development-time type checking. Installing it enables your IDE and type checker to catch type errors in code that calls defusedxml functions, improving code quality without affecting runtime behavior.
Use it for:
- Enable mypy or pyright to type-check code that imports and uses defusedxml for XML parsing
- Catch type errors in defusedxml function calls during development before runtime
- Provide IDE autocomplete and type hints for defusedxml APIs in editors
- Enforce type safety in projects that parse untrusted XML documents using defusedxml
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type hints for the defusedxml library, enabling static type checkers like mypy and pyright to validate code that uses defusedxml.
Yes, if you use defusedxml and run static type checking. Install it alongside defusedxml to enable mypy or pyright to validate your XML parsing code. No runtime cost or dependencies. If you don't use a type checker, this package provides no value.
Install
types-defusedxml on PyPI
pip
pip install types-defusedxmluv
uv add types-defusedxmlpoetry
poetry add types-defusedxmlInstalling types-defusedxml
Before you install
Low install friction with no runtime dependencies. Actively maintained as part of typeshed; last commit 2026-08-14 and latest release 2026-05-04.
License in practice
Apache-2.0 permissive license allows use in most projects without restriction.
Quickstart
pip install types-defusedxml
import defusedxml.ElementTree
tree = defusedxml.ElementTree.parse('file.xml')
Requires Python >=3.10
Verify before relying
- Whether this package is automatically installed as a dependency of defusedxml or must be installed separately
- Whether type checker configuration changes are needed to recognize these stubs
- Performance impact of including type stubs in development environments
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 102 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,357,489/month — #3,107 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_defusedxml-0.7.0.20260504-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
defusedxmlDefusedxml hardens Python's standard XML…
permissive · top 1,000 on PyPI
types-xmltodictProvides type annotations for the xmltodict…
permissive · top 5,000 on PyPI
types-tabulateProvides type hints for the tabulate package,…
permissive · top 5,000 on PyPI
types-html5libProvides type hints for the html5lib HTML…
permissive · top 5,000 on PyPI
types-retryProvides type hints for the retry package,…
permissive · top 5,000 on PyPI
types-MarkdownProvides type stubs for the Markdown package,…
permissive · top 5,000 on PyPI
types-docutilsProvides type hints for the docutils library,…
permissive · top 5,000 on PyPI
types-tomlProvides type hints for the toml package,…
permissive · top 1,000 on PyPI
types-grpcio-reflectionProvides type hints for grpcio-reflection,…
permissive · top 15,000 on PyPI
types-pyperclipProvides type annotations for the pyperclip…
permissive · top 15,000 on PyPI