xsData naive XML Bindings for python


  • Generate code for XML Schema 1.0 definitions

  • Generate namespaces all qualified elements and attributes

  • Generate Enum and inner classes

  • Generate restrictions and rules (validations coming)

  • Reduce schemas overhead by flattening common types

  • Preserve embedded documentation and references

  • Pluggable code writer to support multiple formats

  • Format: Python Data Classes

    • PEP8 naming conventions and code output

    • Full support for type hints even with forward references

    • XML Parser & Serializer based on lxml with type casting

    • JSON Parser & Serializer with type casting

    • Serializer/Parser for xml and json

Check the samples repo for more ✨✨✨

Why naive?

The W3C XML Schema offers so much flexibility and abstraction layers and grammatical rules to support practically any xml document definition.

Itergration teams and clients don’t care about any of that, take out abstraction and flexibility and you are left with lean named data structures with typed attributes and a namespace for humans to read!


  • Add option to split classes in multiple files

  • Python renderers: attrs and pydantic

  • Java renderer: JaxB compatible models :)

  • Validators