docx4j-xsdata
This is the docx4j-python fork of xsdata (MIT). It is the
same library, published as the distribution docx4j-xsdata with the import package
docx4j_xsdata and the console script docx4j-xsdata, so that it can be installed
alongside upstream xsdata in one environment. Code generated by this fork imports
its runtime types from docx4j_xsdata.
- What differs from upstream, release by release: docs/fork/CHANGES.md
- How the fork tracks upstream tags: docs/fork/REBASING.md
- Upstream project, documentation and issue tracker: https://github.com/tefra/xsdata
- The rename is entirely script-generated by tools/rename.py; no part of it is hand-edited.
Upstream's MIT licence and copyright (Christodoulos Tsoulloftas) are unchanged and are kept in LICENSE; the MIT text requires no additional notice for the fork's changes. Modifications in this fork are copyright (c) 2026 Plutext Pty Ltd and are released under the same MIT licence.
The rest of this README is upstream's.
Naive XML Bindings for python
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 docx4j-xsdata[cli,lxml,soap]
$ # Generate models
$ docx4j-xsdata generate tests/fixtures/primer/order.xsd --package tests.fixtures.primer
>>> from tests.fixtures.primer import PurchaseOrder
>>> from docx4j_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.2 (2026-02-15)
Fixes
- Fix elements in same choice different branches incorrectly merged as list (#1206)
Features
Release files for docx4j-xsdata 26.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| docx4j_xsdata-26.2.1.tar.gz | 448.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docx4j_xsdata-26.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 708.6 kB
Release files / docx4j_xsdata-26.2.1.tar.gz
| Download URL | docx4j_xsdata-26.2.1.tar.gz |
|---|---|
| Size | 448.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed6d94725ec059e633d1ddec8e943071d0e5a49d40d32c9fc5854a8da6b1529d
|
|
BLAKE2b-256 checksum How to use checksums |
805581266d180ec9195fc866a47f25c9e41a0541dd7c1a829604bd11a8de3e5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 20, 2026.
Transparency logRelease files / docx4j_xsdata-26.2.1-py3-none-any.whl
| Download URL | docx4j_xsdata-26.2.1-py3-none-any.whl |
|---|---|
| Size | 259.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1dd026ac8b7df1d1590d17cde5bc3cc638461994da44d231cb5a82652f768f8b
|
|
BLAKE2b-256 checksum How to use checksums |
f80f209eb6c5f6cf94fc59b9e19756bc1578525dc7439e95239c811760d2f6be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 20, 2026.
Transparency log