xsdata


Namexsdata JSON
Version 24.5 PyPI version JSON
download
home_pageNone
SummaryPython XML Binding
upload_time2024-05-07 16:28:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords xsd wsdl schema dtd binding xml json dataclasses generator cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![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://img.shields.io/github/languages/top/tefra/xsdata.svg)](https://xsdata.readthedocs.io/)
[![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.5 (2024-05-07)

**Features**

- Rewrite TreeSerializer, drop support for native python ElementTree
  ([#1032](https://github.com/tefra/xsdata/pull/1032))
- Validate fields fixed values ([#1013](https://github.com/tefra/xsdata/pull/1013))
- Detect optional fields in dict mapper
- Refactor typing annotations analyze process
- Generate ForwardRef() instead of Type[]

**Fixes**

- Allow soap client config subclassing
  ([#1010](https://github.com/tefra/xsdata/pull/1010))
- Avoid recursive error on nested group references
  ([#1016](https://github.com/tefra/xsdata/pull/1016))
- Add warning for same module designation
  ([#1018](https://github.com/tefra/xsdata/pull/1018))

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "xsdata",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "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/b4/ef/35d8118f903510f9e028f8a6a4edb615fa69e28a30d955593425a88e587a/xsdata-24.5.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://img.shields.io/github/languages/top/tefra/xsdata.svg)](https://xsdata.readthedocs.io/)\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.5 (2024-05-07)\n\n**Features**\n\n- Rewrite TreeSerializer, drop support for native python ElementTree\n  ([#1032](https://github.com/tefra/xsdata/pull/1032))\n- Validate fields fixed values ([#1013](https://github.com/tefra/xsdata/pull/1013))\n- Detect optional fields in dict mapper\n- Refactor typing annotations analyze process\n- Generate ForwardRef() instead of Type[]\n\n**Fixes**\n\n- Allow soap client config subclassing\n  ([#1010](https://github.com/tefra/xsdata/pull/1010))\n- Avoid recursive error on nested group references\n  ([#1016](https://github.com/tefra/xsdata/pull/1016))\n- Add warning for same module designation\n  ([#1018](https://github.com/tefra/xsdata/pull/1018))\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python XML Binding",
    "version": "24.5",
    "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": "8edcc758235f2b18058de5f74d5e38966e8d5ddccb94f99dfcd87c557c0b808e",
                "md5": "52656ff7a540f4025707a15d420bb391",
                "sha256": "6ff12949083d9a0d9934c50401b347ccbf254bb10bf8472aef956b92662f7858"
            },
            "downloads": -1,
            "filename": "xsdata-24.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52656ff7a540f4025707a15d420bb391",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 229304,
            "upload_time": "2024-05-07T16:28:39",
            "upload_time_iso_8601": "2024-05-07T16:28:39.536225Z",
            "url": "https://files.pythonhosted.org/packages/8e/dc/c758235f2b18058de5f74d5e38966e8d5ddccb94f99dfcd87c557c0b808e/xsdata-24.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4ef35d8118f903510f9e028f8a6a4edb615fa69e28a30d955593425a88e587a",
                "md5": "8135754a4b13cddccba7829367142cf5",
                "sha256": "4e8414a01bff603ca38a361d04d819934fcc525f9b4220f0076e040d84a4a963"
            },
            "downloads": -1,
            "filename": "xsdata-24.5.tar.gz",
            "has_sig": false,
            "md5_digest": "8135754a4b13cddccba7829367142cf5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 339676,
            "upload_time": "2024-05-07T16:28:41",
            "upload_time_iso_8601": "2024-05-07T16:28:41.282797Z",
            "url": "https://files.pythonhosted.org/packages/b4/ef/35d8118f903510f9e028f8a6a4edb615fa69e28a30d955593425a88e587a/xsdata-24.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-07 16:28:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tefra",
    "github_project": "xsdata",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xsdata"
}
        
Elapsed time: 0.34572s