Skip to main content

image

Naive XML Bindings for python

image image image image image image


xsData is a complete data binding library for python allowing developers to access and use XML and JSON documents as simple objects rather than using DOM.

The code generator supports XML schemas, DTD, WSDL definitions, XML & JSON documents. It produces simple dataclasses with type hints and simple binding metadata.

The included XML and JSON parser/serializer are highly optimized and adaptable, with multiple handlers and configuration properties.

xsData is constantly tested against the W3C XML Schema 1.1 test suite.

Getting started

$ # Install all dependencies
$ pip install xsdata[cli,lxml,soap]
$ # Generate models
$ xsdata generate tests/fixtures/primer/order.xsd --package tests.fixtures.primer
>>> from tests.fixtures.primer import PurchaseOrder
>>> from xsdata.formats.dataclass.parsers import XmlParser
>>>
>>> parser = XmlParser()
>>> order = parser.parse("tests/fixtures/primer/sample.xml", PurchaseOrder)
>>> order.bill_to
Usaddress(name='Robert Smith', street='8 Oak Avenue', city='Old Town', state='PA', zip=Decimal('95819'), country='US')

Check the documentation for more ✨✨✨

Features

Code Generator

  • XML Schemas 1.0 & 1.1
  • WSDL 1.1 definitions with SOAP 1.1 bindings
  • DTD external definitions
  • Directly from XML and JSON Documents
  • Extensive configuration to customize output
  • Pluggable code writer for custom output formats

Default Output

  • Pure python dataclasses with metadata
  • Type hints with support for forward references and unions
  • Enumerations and inner classes
  • Support namespace qualified elements and attributes

Data Binding

  • XML and JSON parser, serializer
  • PyCode serializer
  • Handlers and Writers based on lxml and native xml python
  • Support wildcard elements and attributes
  • Support xinclude statements and unknown properties
  • Customize behaviour through config

Changelog: 26.11 (2026-11-26)

Security

Fixes

  • Remove artificial defaults from text nodes (#1240)
  • Accept nil values in nillable type hints (#1244)
  • Alias imports that clash with inner class names (#1244)
  • Bind the schema default of empty optional elements (#1244)

Features

  • Generate StrEnum and IntEnum for typed enumerations (#1242)
  • Add @generated marker to the codegen header (#1243)
  • Add Python 3.15 support (#1241)

Deprecations

  • Removed Python 3.10 support (#1241)

Metadata

Release files for xsdata 26.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xsdata 26.11
File Size Uploaded Provenance Actions
xsdata-26.11.tar.gz 359.5 kB With provenance Details for xsdata-26.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xsdata 26.11
File Interpreter ABI Platform Actions
xsdata-26.11-py3-none-any.whl Python 3 none any Details for xsdata-26.11-py3-none-any.whl

Total release size: 604.2 kB

Release files / xsdata-26.11.tar.gz

Download URL xsdata-26.11.tar.gz
Size 359.5 kB
Tags Source
SHA-256 checksum
How to use checksums
50b7d5c99470a732c6182056d3dd4ca1908c8dc4232213555b81d47baaefe42e
BLAKE2b-256 checksum
How to use checksums
b5003629df4c3e0a6c27402a1eb8e4afd702604a31ac5c42197dbb2f2354a9a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / xsdata-26.11-py3-none-any.whl

Download URL xsdata-26.11-py3-none-any.whl
Size 244.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbea81df990baa1d31a816626a4f0b606a6e4456f431cbc67cb1559d0b98421b
BLAKE2b-256 checksum
How to use checksums
c34bd2553cb32006a73461b03220c052f642e130b747caf4cd774838ce59951c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for xsdata 26.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xsdata-26.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

26.11 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page