xsdata-pydantic-24.5
توضیحات
xsdata pydantic plugin
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | xsdata-pydantic-24.5 |
| نام | xsdata-pydantic |
| نسخه کتابخانه | 24.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Christodoulos Tsoulloftas <chris@komposta.net> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/xsdata-pydantic/ |
| مجوز | MIT |
[](https://xsdata-pydantic.readthedocs.io/)
# xsdata powered by pydantic!
[](https://github.com/tefra/xsdata-pydantic/actions)
[](https://xsdata-pydantic.readthedocs.io/)
[](https://codecov.io/gh/tefra/xsdata-pydantic)
[](https://xsdata-pydantic.readthedocs.io/)
[](https://www.codefactor.io/repository/github/tefra/xsdata-pydantic)
[](https://pypi.org/pypi/xsdata-pydantic/)
[](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
نیازمندی
| مقدار | نام |
|---|---|
| - | pydantic>=2.6 |
| - | xsdata>=24.5 |
| xtr | xsdata[cli]>=24.5; |
| xtr | mkdocs; |
| xtr | mkdocs-gen-files; |
| xtr | mkdocs-literate-nav; |
| xtr | mkdocs-material; |
| xtr | mkdocs-minify-plugin; |
| xtr | mkdocstrings[python]; |
| xtr | markdown-exec[ansi]; |
| xtr | pymdownx-superfence-filter-lines; |
| xtr | lxml>=4.4.1; |
| xtr | requests; |
| xtr | codecov; |
| xtr | lxml; |
| xtr | pre-commit; |
| xtr | pytest; |
| xtr | pytest-cov; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl xsdata-pydantic-24.5:
pip install xsdata-pydantic-24.5.whl
نصب پکیج tar.gz xsdata-pydantic-24.5:
pip install xsdata-pydantic-24.5.tar.gz