Skip to main content

Safely escape ampersands in XML without double-encoding

Project description

xml-sanitizer

Safely escape illegal ampersands in XML without double-encoding.

Why?

XML breaks if raw & exists:

  • Jack & Tom : It will break
  • Jack & Tom : It works for xml without breaking

This library fixes that safely.

Installation

pip install xml-sanitizer

Usage

from xml_sanitizer import xml_content_cleanup

parsed_xml = xml_content_cleanup(xml_file)

print(f"Cleaned XML: {parsed_xml}")

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

xml_sanitizer-0.1.1.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

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

xml_sanitizer-0.1.1-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file xml_sanitizer-0.1.1.tar.gz.

File metadata

  • Download URL: xml_sanitizer-0.1.1.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for xml_sanitizer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6cedec3381af61b7c366b4f1028fb12a8ac8bd700eddd95430cf4cb741b90dce
MD5 9a9ccbdc04d944b011b3b863efe79605
BLAKE2b-256 030f8879c949b0c39a29f3315b36bb86cc8d4553bcfefd0c752e5916faad3185

See more details on using hashes here.

File details

Details for the file xml_sanitizer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xml_sanitizer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for xml_sanitizer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ac2cbe05a81a37be5562fbc9a4520f09138f7331324385d8b9b58a252bf27d5
MD5 bcff9a8b29b29eb8a97c76f6f1cd409f
BLAKE2b-256 2010618e9816400e4da92473f9e6073831b37c8cf2cbaf7ee0a09e81b9fbba9d

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