[![image](https://github.com/tefra/xsdata/raw/main/docs/logo.svg)](https://xsdata.readthedocs.io/)
# Naive XML Bindings for python
[![image](https://github.com/tefra/xsdata/workflows/tests/badge.svg)](https://github.com/tefra/xsdata/actions)
[![image](https://readthedocs.org/projects/xsdata/badge)](https://xsdata.readthedocs.io/)
[![image](https://codecov.io/gh/tefra/xsdata/branch/main/graph/badge.svg)](https://codecov.io/gh/tefra/xsdata)
[![image](https://www.codefactor.io/repository/github/tefra/xsdata/badge)](https://www.codefactor.io/repository/github/tefra/xsdata)
[![image](https://img.shields.io/pypi/pyversions/xsdata.svg)](https://pypi.org/pypi/xsdata/)
[![image](https://img.shields.io/pypi/v/xsdata.svg)](https://pypi.org/pypi/xsdata/)
---
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](https://github.com/tefra/xsdata-w3c-tests).
## Getting started
```console
$ # Install all dependencies
$ pip install xsdata[cli,lxml,soap]
```
```console
$ # Generate models
$ xsdata tests/fixtures/primer/order.xsd --package tests.fixtures.primer
```
```python
>>> 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](https://xsdata.readthedocs.io) 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: 24.11 (2024-11-03)
**Fixes**
- Avoid conflict with attributes named value when flattening extensions
([#1085](https://github.com/tefra/xsdata/pull/1085))
**Features**
- Add cli config to use generic collections
([#1082](https://github.com/tefra/xsdata/pull/1082))
**Deprecations**
- Drop support for python 3.8
Raw data
{
"_id": null,
"home_page": null,
"name": "xsdata",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "xsd, wsdl, schema, dtd, binding, xml, json, dataclasses, generator, cli",
"author": null,
"author_email": "Christodoulos Tsoulloftas <chris@komposta.net>",
"download_url": "https://files.pythonhosted.org/packages/66/68/2c87ceae0788b6468a637d3d63cd6fcc90ca6b6029e8d23b9313d3d9b741/xsdata-24.11.tar.gz",
"platform": null,
"description": "[![image](https://github.com/tefra/xsdata/raw/main/docs/logo.svg)](https://xsdata.readthedocs.io/)\n\n# Naive XML Bindings for python\n\n[![image](https://github.com/tefra/xsdata/workflows/tests/badge.svg)](https://github.com/tefra/xsdata/actions)\n[![image](https://readthedocs.org/projects/xsdata/badge)](https://xsdata.readthedocs.io/)\n[![image](https://codecov.io/gh/tefra/xsdata/branch/main/graph/badge.svg)](https://codecov.io/gh/tefra/xsdata)\n[![image](https://www.codefactor.io/repository/github/tefra/xsdata/badge)](https://www.codefactor.io/repository/github/tefra/xsdata)\n[![image](https://img.shields.io/pypi/pyversions/xsdata.svg)](https://pypi.org/pypi/xsdata/)\n[![image](https://img.shields.io/pypi/v/xsdata.svg)](https://pypi.org/pypi/xsdata/)\n\n---\n\nxsData is a complete data binding library for python allowing developers to access and\nuse XML and JSON documents as simple objects rather than using DOM.\n\nThe code generator supports XML schemas, DTD, WSDL definitions, XML & JSON documents. It\nproduces simple dataclasses with type hints and simple binding metadata.\n\nThe included XML and JSON parser/serializer are highly optimized and adaptable, with\nmultiple handlers and configuration properties.\n\nxsData is constantly tested against the\n[W3C XML Schema 1.1 test suite](https://github.com/tefra/xsdata-w3c-tests).\n\n## Getting started\n\n```console\n$ # Install all dependencies\n$ pip install xsdata[cli,lxml,soap]\n```\n\n```console\n$ # Generate models\n$ xsdata tests/fixtures/primer/order.xsd --package tests.fixtures.primer\n```\n\n```python\n>>> from tests.fixtures.primer import PurchaseOrder\n>>> from xsdata.formats.dataclass.parsers import XmlParser\n>>>\n>>> parser = XmlParser()\n>>> order = parser.parse(\"tests/fixtures/primer/sample.xml\", PurchaseOrder)\n>>> order.bill_to\nUsaddress(name='Robert Smith', street='8 Oak Avenue', city='Old Town', state='PA', zip=Decimal('95819'), country='US')\n```\n\nCheck the [documentation](https://xsdata.readthedocs.io) for more \u2728\u2728\u2728\n\n## Features\n\n**Code Generator**\n\n- XML Schemas 1.0 & 1.1\n- WSDL 1.1 definitions with SOAP 1.1 bindings\n- DTD external definitions\n- Directly from XML and JSON Documents\n- Extensive configuration to customize output\n- Pluggable code writer for custom output formats\n\n**Default Output**\n\n- Pure python dataclasses with metadata\n- Type hints with support for forward references and unions\n- Enumerations and inner classes\n- Support namespace qualified elements and attributes\n\n**Data Binding**\n\n- XML and JSON parser, serializer\n- PyCode serializer\n- Handlers and Writers based on lxml and native xml python\n- Support wildcard elements and attributes\n- Support xinclude statements and unknown properties\n- Customize behaviour through config\n\n## Changelog: 24.11 (2024-11-03)\n\n**Fixes**\n\n- Avoid conflict with attributes named value when flattening extensions\n ([#1085](https://github.com/tefra/xsdata/pull/1085))\n\n**Features**\n\n- Add cli config to use generic collections\n ([#1082](https://github.com/tefra/xsdata/pull/1082))\n\n**Deprecations**\n\n- Drop support for python 3.8\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python XML Binding",
"version": "24.11",
"project_urls": {
"Changelog": "https://xsdata.readthedocs.io/en/latest/changelog/",
"Documentation": "https://xsdata.readthedocs.io/",
"Homepage": "https://github.com/tefra/xsdata",
"Source": "https://github.com/tefra/xsdata"
},
"split_keywords": [
"xsd",
" wsdl",
" schema",
" dtd",
" binding",
" xml",
" json",
" dataclasses",
" generator",
" cli"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a1955dfb080e293175ed7c490a765bcf382827596b24ce5375aa0e4d785e961a",
"md5": "2c0e85115291fb9587fdb4da3f8ceaba",
"sha256": "bb0ba63daab93c190cfc7d8bb3c2392422cc2ad0b7214f3061cf4cde231cce97"
},
"downloads": -1,
"filename": "xsdata-24.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2c0e85115291fb9587fdb4da3f8ceaba",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 229319,
"upload_time": "2024-11-03T07:22:52",
"upload_time_iso_8601": "2024-11-03T07:22:52.143960Z",
"url": "https://files.pythonhosted.org/packages/a1/95/5dfb080e293175ed7c490a765bcf382827596b24ce5375aa0e4d785e961a/xsdata-24.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "66682c87ceae0788b6468a637d3d63cd6fcc90ca6b6029e8d23b9313d3d9b741",
"md5": "fa0366ca04ca6e5b98520a008aa0f5d6",
"sha256": "011193f775877d832d736b68e8553de3fe35b8447974effce08fc6cc3305d206"
},
"downloads": -1,
"filename": "xsdata-24.11.tar.gz",
"has_sig": false,
"md5_digest": "fa0366ca04ca6e5b98520a008aa0f5d6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 340206,
"upload_time": "2024-11-03T07:22:54",
"upload_time_iso_8601": "2024-11-03T07:22:54.025997Z",
"url": "https://files.pythonhosted.org/packages/66/68/2c87ceae0788b6468a637d3d63cd6fcc90ca6b6029e8d23b9313d3d9b741/xsdata-24.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-03 07:22:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tefra",
"github_project": "xsdata",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "xsdata"
}