{"categories":[{"label":"XML","url":"https://skillfed.io/packages/category/text-processing-markup-xml"}],"enrichment":{"capability":"Formats and compresses XML documents by applying distinct whitespace rules that treat element content as objects and mixed content as text, with options to preserve specific elements and customize indentation.","skillfed_tags":["xml-formatting","cli-tool"],"use_cases":["Pretty-print XML configuration files for readability and version control diffs","Minify XML documents to reduce file size for transmission or storage","Normalize whitespace in mixed-content XML (like XHTML or DocBook) while preserving text semantics","Automate XML formatting in build pipelines or pre-commit hooks via the command-line tool","Preserve specific XML subtrees (e.g. code blocks or literal content) while formatting the rest of a document"],"what_it_does":"xmlformatter is a Python 3 XML formatting library that normalizes whitespace in XML documents according to a set of explicit rules. It distinguishes between element content (treated as structured data) and mixed content (treated as text), applying different formatting strategies to each. For element content, it removes leading and trailing whitespace and collapses whitespace sequences; for mixed content, it preserves text flow while normalizing spacing around inline elements. The package provides both a programmatic API via the Formatter class and a command-line tool (xmlformat) for standalone use.\n\nThe library supports customization through options like indentation width and character, output encoding, element preservation (to skip formatting subtrees), and compression modes. It can read from files, strings, or stdin, and write to files or stdout. The package is a Python 3 replacement for the older Python 2 XmlFormatter package and includes migration guidance for existing users.","worth_installing":"Yes. xmlformatter is a lightweight, actively maintained tool with no external dependencies, a permissive MIT license, and no known vulnerabilities. Install it if you need to format, normalize, or compress XML documents\u2014either programmatically or from the command line. The distinct handling of element vs. mixed content makes it useful for documents that blend structured data and natural language text."},"id":"xmlformatter","links":{"html":"https://skillfed.io/packages/xmlformatter","md":"https://skillfed.io/packages/xmlformatter.md","pypi":"https://pypi.org/project/xmlformatter/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-06","license_spdx":"MIT","license_treatment":"permissive","name":"xmlformatter","python_support":"supports_current","summary":"Format and compress XML documents"},"popularity":{"monthly_downloads":92197,"position":13469,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.2.9"}
