--- id: xsdata version: "26.2" license: MIT license_treatment: permissive maintenance: active --- # xsdata — Python XML Binding License: permissive · Maintenance: active · Downloads: 3.5M/mo ## What it is and what it does xsdata is a data binding library that bridges the gap between XML and JSON documents and Python code. It works in two phases: first, a code generator reads XML schemas, WSDL definitions, DTD files, or sample XML and JSON documents and produces strongly-typed Python dataclasses with metadata; second, optimized parsers and serializers let you load and save those documents as instances of the generated classes, avoiding manual DOM manipulation. The library targets developers who work with structured XML or JSON data and want type safety. It includes a CLI tool for code generation, supports namespace-qualified elements and attributes, handles wildcards and xinclude statements, and offers multiple handler backends. The generated code is pure Python with type hints, making it compatible with modern tooling. Use it for: - Generate Python models from an existing XSD schema and parse XML documents into typed objects. - Convert WSDL service definitions into Python dataclasses for SOAP client integration. - Infer Python dataclasses directly from sample XML or JSON files without a formal schema. - Serialize Python objects back to XML or JSON with full namespace support. - Build tools that consume structured XML configuration or data files with type safety. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. xsdata generates Python dataclasses from XML schemas, WSDL, DTD, and JSON documents, then parses and serializes XML and JSON data using those generated models. Yes. xsdata is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real problem for anyone working with XML schemas or WSDL in Python. The MIT license imposes no restrictions. It is suitable for production use in data binding, schema-driven code generation, and XML/JSON serialization workflows. ## Install pip install xsdata uv add xsdata poetry add xsdata ## Installing xsdata Before you install: Low friction: pure Python wheel with a single runtime dependency (typing-extensions). The package is actively maintained with recent releases and no known vulnerabilities. License in practice: MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute xsdata freely provided you retain the license notice. Quickstart: pip install xsdata xsdata generate schema.xsd --package models from xsdata.formats.dataclass.parsers import XmlParser parser = XmlParser() obj = parser.parse('data.xml', MyElement) Requires Python 3.10 or later. Optional CLI and SOAP support require additional dependencies (lxml, etc.). Verify before relying: - Performance characteristics when parsing or generating code for very large schemas or documents. - Completeness of W3C XML Schema 1.1 test suite coverage beyond the stated testing claim. - Whether generated dataclasses work seamlessly with type checkers and IDE autocomplete. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags xml schema to python dataclass, xml binding library, wsdl code generator, xml json parser serializer, dtd to dataclass, xml data binding, schema-driven code generation, code-generation, xml-binding, schema-driven [View on SkillFed](https://skillfed.io/packages/xsdata) · [View on PyPI](https://pypi.org/project/xsdata/)