xsdata-pydantic


Namexsdata-pydantic JSON
Version 24.5 PyPI version JSON
download
home_pageNone
Summaryxsdata pydantic plugin
upload_time2024-05-08 17:49:48
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords xsd wsdl schema dtd binding xml json dataclasses generator cli pydantic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![image](https://github.com/tefra/xsdata-pydantic/raw/main/docs/logo.svg)](https://xsdata-pydantic.readthedocs.io/)

# xsdata powered by pydantic!

[![image](https://github.com/tefra/xsdata-pydantic/workflows/tests/badge.svg)](https://github.com/tefra/xsdata-pydantic/actions)
[![image](https://readthedocs.org/projects/xsdata-pydantic/badge)](https://xsdata-pydantic.readthedocs.io/)
[![image](https://codecov.io/gh/tefra/xsdata-pydantic/branch/main/graph/badge.svg)](https://codecov.io/gh/tefra/xsdata-pydantic)
[![image](https://img.shields.io/github/languages/top/tefra/xsdata-pydantic.svg)](https://xsdata-pydantic.readthedocs.io/)
[![image](https://www.codefactor.io/repository/github/tefra/xsdata-pydantic/badge)](https://www.codefactor.io/repository/github/tefra/xsdata-pydantic)
[![image](https://img.shields.io/pypi/pyversions/xsdata-pydantic.svg)](https://pypi.org/pypi/xsdata-pydantic/)
[![image](https://img.shields.io/pypi/v/xsdata-pydantic.svg)](https://pypi.org/pypi/xsdata-pydantic/)

---

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.

Now powered by pydantic!

```console
$ xsdata http://rss.cnn.com/rss/edition.rss --output pydantic
Parsing document edition.rss
Analyzer input: 9 main and 0 inner classes
Analyzer output: 9 main and 0 inner classes
Generating package: init
Generating package: generated.rss
```

```python
class Rss(BaseModel):
    class Meta:
        name = "rss"

    model_config = ConfigDict(defer_build=True)
    version: float = field(
        metadata={
            "type": "Attribute",
            "required": True,
        }
    )
    channel: Channel = field(
        metadata={
            "type": "Element",
            "required": True,
        }
    )
```

```console

>>> from xsdata_pydantic.bindings import XmlParser
>>> from urllib.request import urlopen
>>> from generated.rss import Rss
>>>
>>> parser = XmlParser()
>>> with urlopen("http://rss.cnn.com/rss/edition.rss") as rq:
...     result = parser.parse(rq, Rss)
...
>>> result.channel.item[2].title
'Vatican indicts 10 people, including a Cardinal, over an international financial scandal'
>>> result.channel.item[2].pub_date
'Sat, 03 Jul 2021 16:37:14 GMT'
>>> result.channel.item[2].link
'https://www.cnn.com/2021/07/03/europe/vatican-financial-scandal-intl/index.html'

```

## Changelog: 24.5 (2024-05-08)

- Support pydantic v2 models
- Add missing parser/serializer shortcuts
- General project maintenance

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "xsdata-pydantic",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "xsd, wsdl, schema, dtd, binding, xml, json, dataclasses, generator, cli, pydantic",
    "author": null,
    "author_email": "Christodoulos Tsoulloftas <chris@komposta.net>",
    "download_url": "https://files.pythonhosted.org/packages/85/5e/6bc728d70460d9ad3982d05c3765179e3584fee6fa523d57b242e6e4c50f/xsdata_pydantic-24.5.tar.gz",
    "platform": null,
    "description": "[![image](https://github.com/tefra/xsdata-pydantic/raw/main/docs/logo.svg)](https://xsdata-pydantic.readthedocs.io/)\n\n# xsdata powered by pydantic!\n\n[![image](https://github.com/tefra/xsdata-pydantic/workflows/tests/badge.svg)](https://github.com/tefra/xsdata-pydantic/actions)\n[![image](https://readthedocs.org/projects/xsdata-pydantic/badge)](https://xsdata-pydantic.readthedocs.io/)\n[![image](https://codecov.io/gh/tefra/xsdata-pydantic/branch/main/graph/badge.svg)](https://codecov.io/gh/tefra/xsdata-pydantic)\n[![image](https://img.shields.io/github/languages/top/tefra/xsdata-pydantic.svg)](https://xsdata-pydantic.readthedocs.io/)\n[![image](https://www.codefactor.io/repository/github/tefra/xsdata-pydantic/badge)](https://www.codefactor.io/repository/github/tefra/xsdata-pydantic)\n[![image](https://img.shields.io/pypi/pyversions/xsdata-pydantic.svg)](https://pypi.org/pypi/xsdata-pydantic/)\n[![image](https://img.shields.io/pypi/v/xsdata-pydantic.svg)](https://pypi.org/pypi/xsdata-pydantic/)\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\nNow powered by pydantic!\n\n```console\n$ xsdata http://rss.cnn.com/rss/edition.rss --output pydantic\nParsing document edition.rss\nAnalyzer input: 9 main and 0 inner classes\nAnalyzer output: 9 main and 0 inner classes\nGenerating package: init\nGenerating package: generated.rss\n```\n\n```python\nclass Rss(BaseModel):\n    class Meta:\n        name = \"rss\"\n\n    model_config = ConfigDict(defer_build=True)\n    version: float = field(\n        metadata={\n            \"type\": \"Attribute\",\n            \"required\": True,\n        }\n    )\n    channel: Channel = field(\n        metadata={\n            \"type\": \"Element\",\n            \"required\": True,\n        }\n    )\n```\n\n```console\n\n>>> from xsdata_pydantic.bindings import XmlParser\n>>> from urllib.request import urlopen\n>>> from generated.rss import Rss\n>>>\n>>> parser = XmlParser()\n>>> with urlopen(\"http://rss.cnn.com/rss/edition.rss\") as rq:\n...     result = parser.parse(rq, Rss)\n...\n>>> result.channel.item[2].title\n'Vatican indicts 10 people, including a Cardinal, over an international financial scandal'\n>>> result.channel.item[2].pub_date\n'Sat, 03 Jul 2021 16:37:14 GMT'\n>>> result.channel.item[2].link\n'https://www.cnn.com/2021/07/03/europe/vatican-financial-scandal-intl/index.html'\n\n```\n\n## Changelog: 24.5 (2024-05-08)\n\n- Support pydantic v2 models\n- Add missing parser/serializer shortcuts\n- General project maintenance\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "xsdata pydantic plugin",
    "version": "24.5",
    "project_urls": {
        "Changelog": "https://xsdata-pydantic.readthedocs.io/en/latest/changelog.html",
        "Documentation": "https://xsdata-pydantic.readthedocs.io/",
        "Homepage": "https://github.com/tefra/xsdata-pydantic",
        "Source": "https://github.com/tefra/xsdata-pydantic"
    },
    "split_keywords": [
        "xsd",
        " wsdl",
        " schema",
        " dtd",
        " binding",
        " xml",
        " json",
        " dataclasses",
        " generator",
        " cli",
        " pydantic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b77b785fe71aa1138d7380ab3926cbb9571896d56544901c320953ff8a586926",
                "md5": "bd5e66dc581fb24b30e59750ee75c1fa",
                "sha256": "bb6da7d3445d655640096c65c1b11037153b19df533da89553f24247ef352cd0"
            },
            "downloads": -1,
            "filename": "xsdata_pydantic-24.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bd5e66dc581fb24b30e59750ee75c1fa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8891,
            "upload_time": "2024-05-08T17:49:46",
            "upload_time_iso_8601": "2024-05-08T17:49:46.408847Z",
            "url": "https://files.pythonhosted.org/packages/b7/7b/785fe71aa1138d7380ab3926cbb9571896d56544901c320953ff8a586926/xsdata_pydantic-24.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "855e6bc728d70460d9ad3982d05c3765179e3584fee6fa523d57b242e6e4c50f",
                "md5": "0a13d57a32b0bf909f6af3c56ff68699",
                "sha256": "e3c8758133195657ece578537eda6c7ebd8419f77abf6b90fd4ced96e348129b"
            },
            "downloads": -1,
            "filename": "xsdata_pydantic-24.5.tar.gz",
            "has_sig": false,
            "md5_digest": "0a13d57a32b0bf909f6af3c56ff68699",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18763,
            "upload_time": "2024-05-08T17:49:48",
            "upload_time_iso_8601": "2024-05-08T17:49:48.280172Z",
            "url": "https://files.pythonhosted.org/packages/85/5e/6bc728d70460d9ad3982d05c3765179e3584fee6fa523d57b242e6e4c50f/xsdata_pydantic-24.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 17:49:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tefra",
    "github_project": "xsdata-pydantic",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xsdata-pydantic"
}
        
Elapsed time: 0.24438s