[![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 generate 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.12 (2024-12-22)
**Fixes**
- Set the default value of prohibited fields to None
([#1098](https://github.com/tefra/xsdata/pull/1098))
- Set body and fault as optional in output soap classes
([#1099](https://github.com/tefra/xsdata/pull/1099))
- Resolve a conflict with type location when an element and a complex type have the same
name ([#1107](https://github.com/tefra/xsdata/pull/1107))
**Features**
- Allow Xml Parser subclasses to override how the root class is located
([#1090](https://github.com/tefra/xsdata/pull/1090))
- Include common soap encoding schema
([#1100](https://github.com/tefra/xsdata/pull/1100))
**Deprecations**
- Remove subscritable types config option
- Remove Type,Tuple,List,Dict from stop words
- Deprecate xsdata <SOURCE> shorthand, use xsdata generate <SOURCE> instead
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/29/82/c2b73724bdd31f81e263e1f87e4b9bd70703dd4282ce44ffe1978cda541b/xsdata-24.12.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 generate 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.12 (2024-12-22)\n\n**Fixes**\n\n- Set the default value of prohibited fields to None\n ([#1098](https://github.com/tefra/xsdata/pull/1098))\n\n- Set body and fault as optional in output soap classes\n ([#1099](https://github.com/tefra/xsdata/pull/1099))\n\n- Resolve a conflict with type location when an element and a complex type have the same\n name ([#1107](https://github.com/tefra/xsdata/pull/1107))\n\n**Features**\n\n- Allow Xml Parser subclasses to override how the root class is located\n ([#1090](https://github.com/tefra/xsdata/pull/1090))\n\n- Include common soap encoding schema\n ([#1100](https://github.com/tefra/xsdata/pull/1100))\n\n**Deprecations**\n\n- Remove subscritable types config option\n- Remove Type,Tuple,List,Dict from stop words\n- Deprecate xsdata <SOURCE> shorthand, use xsdata generate <SOURCE> instead\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python XML Binding",
"version": "24.12",
"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": "0ce570026869f5ab3c6be413ab5a978849cfe2037f2e82bd1da8550c7627caa3",
"md5": "d8089f95d80a70c34605730d428cfc32",
"sha256": "2656cfa7240d215a4f2ff30abeebee9afad1e72b805f3ed29ded518a7d3785ee"
},
"downloads": -1,
"filename": "xsdata-24.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d8089f95d80a70c34605730d428cfc32",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 232617,
"upload_time": "2024-12-22T07:25:16",
"upload_time_iso_8601": "2024-12-22T07:25:16.665887Z",
"url": "https://files.pythonhosted.org/packages/0c/e5/70026869f5ab3c6be413ab5a978849cfe2037f2e82bd1da8550c7627caa3/xsdata-24.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2982c2b73724bdd31f81e263e1f87e4b9bd70703dd4282ce44ffe1978cda541b",
"md5": "e42b56a983e64854bfaab578e4f5378d",
"sha256": "67c16c032bbde82c064f6c28cdf6b4f8adcbd0498e2668a346ff8e52a3a200b4"
},
"downloads": -1,
"filename": "xsdata-24.12.tar.gz",
"has_sig": false,
"md5_digest": "e42b56a983e64854bfaab578e4f5378d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 343596,
"upload_time": "2024-12-22T07:25:19",
"upload_time_iso_8601": "2024-12-22T07:25:19.352035Z",
"url": "https://files.pythonhosted.org/packages/29/82/c2b73724bdd31f81e263e1f87e4b9bd70703dd4282ce44ffe1978cda541b/xsdata-24.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-22 07:25:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tefra",
"github_project": "xsdata",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "xsdata"
}