--- id: xsdata-pydantic version: "24.5" license: MIT license_treatment: permissive maintenance: active --- # xsdata-pydantic — xsdata pydantic plugin License: permissive · Maintenance: active · Downloads: 313.2K/mo ## What it is and what it does xsdata-pydantic bridges XML/JSON schema definitions and pydantic's type system. It uses xsdata to parse XSD, WSDL, and DTD schemas, then generates pydantic BaseModel classes that represent the document structure. Once generated, you can parse XML or JSON into typed Python objects and serialize them back, gaining IDE autocomplete, runtime validation, and type checking throughout your workflow. The package is typically used in two phases: first, run the xsdata CLI to generate model files from a schema; then, import those models and use XmlParser or serializers from xsdata-pydantic.bindings to read and write documents. It's designed for developers who work with structured data formats and want the safety and ergonomics of pydantic's validation without manually writing model classes. Use it for: - Parse RSS/Atom feeds or SOAP responses into typed objects with validation. - Generate Python models from enterprise WSDL or XSD files for API integration. - Serialize Python dataclasses back to XML with schema-aware structure and attributes. - Build data pipelines that consume JSON or XML from external sources with type safety. - Validate incoming XML documents against a schema before processing in your application. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates pydantic models from XML and JSON schemas, then parses and serializes XML/JSON documents as typed Python objects using those models. Yes. Low install friction, active maintenance, no known vulnerabilities, permissive MIT license, and broad Python version support. Solves a real problem for anyone working with XML schemas or WSDL in Python and wanting pydantic's validation and type safety. Suitable for production use. ## Install pip install xsdata-pydantic uv add xsdata-pydantic poetry add xsdata-pydantic ## Installing xsdata-pydantic Before you install: Low friction install with only pydantic and xsdata as runtime dependencies. Actively maintained with recent commits and support for current Python versions. License in practice: MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions. Quickstart: pip install xsdata-pydantic from xsdata_pydantic.bindings import XmlParser parser = XmlParser() result = parser.parse(open('document.xml'), Rss) print(result.channel.item[0].title) Requires xsdata CLI to generate pydantic models from XSD/WSDL schemas first; Python 3.8 or later. Verify before relying: - Whether generated models handle deeply nested or recursive schema structures reliably. - Performance characteristics when parsing very large XML or JSON documents. - Compatibility with all pydantic v2 features and validation modes. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 313.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags xml to pydantic model generator, json schema binding pydantic, xsd code generation, xml parsing with type hints, schema-driven data binding, xml serialization pydantic, wsdl to python models, schema-binding, code-generation, xml-json [View on SkillFed](https://skillfed.io/packages/xsdata-pydantic) · [View on PyPI](https://pypi.org/project/xsdata-pydantic/)