Skip to main content

Secure XML processing for Python — drop-in defusedxml replacement

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmlguard-0.1.0.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmlguard-0.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file xmlguard-0.1.0.tar.gz.

File metadata

  • Download URL: xmlguard-0.1.0.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for xmlguard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 246d5e681a489f3c221c68d9d5d260a6f17452cde7914d06b93b2fa62d7729dc
MD5 d027144ed9838912afb57925c00381d0
BLAKE2b-256 cbce449a5c072fc9c73854e616dfe3544bd85f4e96b23d9212c8d069213dcf05

See more details on using hashes here.

File details

Details for the file xmlguard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xmlguard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for xmlguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ca47d792256a728901470115234ef2eee44711dce73fbc213e09b775edca707
MD5 2c881ddaebda676874a785063c027c26
BLAKE2b-256 405cffc9394c60a15806555ae795deb919acc76907bd961772af860fbcc23456

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page