A Python library to format (pretty-print) and compress XML documents. Supports both files and strings, with options for indentation, encoding, and XML declaration handling. Current version: 0.2.9. Release cadence: infrequent.
pip install xmlformatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize a formatter, format an XML string, and print the pretty-printed result.
Use formatter = XmlFormatter(xml_declaration=True) to always output declaration.
Use indent=' ' or indent='\t' explicitly as a string.
Replace preserve_whitespace=True with preserve=True in XmlFormatter constructor.
No dependency data recorded yet.
No resource links recorded.