Skip to main content

image

xsdata powered by pydantic!

image image image image image image image


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!

$ 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
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,
        }
    )
>>> 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

Release files for xsdata-pydantic 24.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xsdata-pydantic 24.5
File Size Uploaded
xsdata_pydantic-24.5.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xsdata-pydantic 24.5
File Interpreter ABI Platform
xsdata_pydantic-24.5-py3-none-any.whl Python 3 none any Details

Total release size: 27.7 kB

Release files / xsdata_pydantic-24.5.tar.gz

Download URL xsdata_pydantic-24.5.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e3c8758133195657ece578537eda6c7ebd8419f77abf6b90fd4ced96e348129b
BLAKE2b-256 checksum
How to use checksums
855e6bc728d70460d9ad3982d05c3765179e3584fee6fa523d57b242e6e4c50f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / xsdata_pydantic-24.5-py3-none-any.whl

Download URL xsdata_pydantic-24.5-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb6da7d3445d655640096c65c1b11037153b19df533da89553f24247ef352cd0
BLAKE2b-256 checksum
How to use checksums
b77b785fe71aa1138d7380ab3926cbb9571896d56544901c320953ff8a586926
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

24.5 This release

2 release files

22.10

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page