Skip to main content

xsdata attrs plugin

Project description

xsdata powered by attrs!

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


$ # Install with cli support
$ pip install xsdata-attrs[cli]

Generate Models

$ # Generate models
$ xsdata --output attrs
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:
    class Meta:
        name = "rss"

    version: Optional[float] = attr.ib(
            "type": "Attribute",
    channel: Optional[Channel] = attr.ib(
            "type": "Element",


XML Parsing

>>> from xsdata_attrs.bindings import XmlParser
>>> from urllib.request import urlopen
>>> from generated.rss import Rss
>>> parser = XmlParser()
>>> with urlopen("") as rq:
...     result = parser.parse(rq, Rss)
'Vatican indicts 10 people, including a Cardinal, over an international financial scandal'
'Sat, 03 Jul 2021 16:37:14 GMT'

Changelog: 21.11 (2021-11-02)

  • Fixed dataclass.unsafe_hash mapping to attrs.hash property #7

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xsdata_attrs-21.11.tar.gz (18.9 kB view hashes)

Uploaded source

Built Distribution

xsdata_attrs-21.11-py3-none-any.whl (7.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page