xmlguard
Secure XML processing for Python. Drop-in replacement for defusedxml.
Features
- Safe wrappers for all stdlib XML parsers (ElementTree, minidom, SAX, pulldom, expat)
- Blocks entity expansion bombs (Billion Laughs), XXE injection, DTD retrieval
- Configurable limits for entity expansions, DTD depth, element depth, XML size
- Zero runtime dependencies, Python 3.10+
- Full type annotations (PEP 561)
- defusedxml compatibility layer for zero-change migration
Installation
pip install xmlguard
Usage
from xmlguard.ElementTree import parse
# Safe by default — entities, external entities, and DTDs are blocked
tree = parse("data.xml")
License
MIT
Metadata
Release files for xmlguard 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xmlguard-0.1.0.tar.gz | 35.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xmlguard-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.5 kB
Release files / xmlguard-0.1.0.tar.gz
| Download URL | xmlguard-0.1.0.tar.gz |
|---|---|
| Size | 35.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
246d5e681a489f3c221c68d9d5d260a6f17452cde7914d06b93b2fa62d7729dc
|
|
BLAKE2b-256 checksum How to use checksums |
cbce449a5c072fc9c73854e616dfe3544bd85f4e96b23d9212c8d069213dcf05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xmlguard-0.1.0-py3-none-any.whl
| Download URL | xmlguard-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ca47d792256a728901470115234ef2eee44711dce73fbc213e09b775edca707
|
|
BLAKE2b-256 checksum How to use checksums |
405cffc9394c60a15806555ae795deb919acc76907bd961772af860fbcc23456
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|