Metadata-Version: 2.1
Name: xsdata-pydantic
Version: 24.5
Summary: xsdata pydantic plugin
Author-email: Christodoulos Tsoulloftas <chris@komposta.net>
License: MIT
Project-URL: Homepage, https://github.com/tefra/xsdata-pydantic
Project-URL: Source, https://github.com/tefra/xsdata-pydantic
Project-URL: Documentation, https://xsdata-pydantic.readthedocs.io/
Project-URL: Changelog, https://xsdata-pydantic.readthedocs.io/en/latest/changelog.html
Keywords: xsd,wsdl,schema,dtd,binding,xml,json,dataclasses,generator,cli,pydantic
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Text Processing :: Markup :: XML
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.6
Requires-Dist: xsdata>=24.5
Provides-Extra: cli
Requires-Dist: xsdata[cli]>=24.5; extra == "cli"
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-gen-files; extra == "docs"
Requires-Dist: mkdocs-literate-nav; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocs-minify-plugin; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Requires-Dist: markdown-exec[ansi]; extra == "docs"
Requires-Dist: pymdownx-superfence-filter-lines; extra == "docs"
Provides-Extra: lxml
Requires-Dist: lxml>=4.4.1; extra == "lxml"
Provides-Extra: soap
Requires-Dist: requests; extra == "soap"
Provides-Extra: test
Requires-Dist: codecov; extra == "test"
Requires-Dist: lxml; extra == "test"
Requires-Dist: pre-commit; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"

[![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
