xsdata-attrs


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

# xsdata powered by attrs!

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

```console
$ xsdata http://rss.cnn.com/rss/edition.rss --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
```

```python
@attr.s
class Rss:
    class Meta:
        name = "rss"

    version: Optional[float] = attr.ib(
        default=None,
        metadata={
            "type": "Attribute",
        }
    )
    channel: Optional[Channel] = attr.ib(
        default=None,
        metadata={
            "type": "Element",
        }
    )
```

```console

>>> from xsdata_attrs.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)

- Bump xsdata minimum version v24.5

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "xsdata-attrs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "xsd, wsdl, schema, dtd, binding, xml, json, dataclasses, generator, cli, attrs",
    "author": null,
    "author_email": "Christodoulos Tsoulloftas <chris@komposta.net>",
    "download_url": "https://files.pythonhosted.org/packages/5a/cb/449af0758e06db8f00ea040cfee25d3b28ba8e63ca1411b6604d777d5ee3/xsdata_attrs-24.5.tar.gz",
    "platform": null,
    "description": "[![image](https://github.com/tefra/xsdata-attrs/raw/main/docs/logo.svg)](https://xsdata-attrs.readthedocs.io/)\n\n# xsdata powered by attrs!\n\n[![image](https://github.com/tefra/xsdata-attrs/workflows/tests/badge.svg)](https://github.com/tefra/xsdata-attrs/actions)\n[![image](https://readthedocs.org/projects/xsdata-attrs/badge)](https://xsdata-attrs.readthedocs.io/)\n[![image](https://codecov.io/gh/tefra/xsdata-attrs/branch/main/graph/badge.svg)](https://codecov.io/gh/tefra/xsdata-attrs)\n[![image](https://img.shields.io/github/languages/top/tefra/xsdata-attrs.svg)](https://xsdata-attrs.readthedocs.io/)\n[![image](https://www.codefactor.io/repository/github/tefra/xsdata-attrs/badge)](https://www.codefactor.io/repository/github/tefra/xsdata-attrs)\n[![image](https://img.shields.io/pypi/pyversions/xsdata-attrs.svg)](https://pypi.org/pypi/xsdata-attrs/)\n[![image](https://img.shields.io/pypi/v/xsdata-attrs.svg)](https://pypi.org/pypi/xsdata-attrs/)\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 attrs!\n\n```console\n$ xsdata http://rss.cnn.com/rss/edition.rss --output attrs\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\n@attr.s\nclass Rss:\n    class Meta:\n        name = \"rss\"\n\n    version: Optional[float] = attr.ib(\n        default=None,\n        metadata={\n            \"type\": \"Attribute\",\n        }\n    )\n    channel: Optional[Channel] = attr.ib(\n        default=None,\n        metadata={\n            \"type\": \"Element\",\n        }\n    )\n```\n\n```console\n\n>>> from xsdata_attrs.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- Bump xsdata minimum version v24.5\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "xsdata attrs plugin",
    "version": "24.5",
    "project_urls": {
        "Changelog": "https://xsdata-attrs.readthedocs.io/en/latest/changelog/",
        "Documentation": "https://xsdata-attrs.readthedocs.io/",
        "Homepage": "https://github.com/tefra/xsdata-attrs",
        "Source": "https://github.com/tefra/xsdata-attrs"
    },
    "split_keywords": [
        "xsd",
        " wsdl",
        " schema",
        " dtd",
        " binding",
        " xml",
        " json",
        " dataclasses",
        " generator",
        " cli",
        " attrs"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0a024ab2d4c4a1fcb3388b476c67275018e627396cb9865535771f574f043da8",
                "md5": "4622f9e200f6bea7c7f99624603ec090",
                "sha256": "45583c4b4e793b624d3f254de0cdb24bd446da2e8ab987f7a8f1259486c1941d"
            },
            "downloads": -1,
            "filename": "xsdata_attrs-24.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4622f9e200f6bea7c7f99624603ec090",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7951,
            "upload_time": "2024-05-08T17:20:25",
            "upload_time_iso_8601": "2024-05-08T17:20:25.776818Z",
            "url": "https://files.pythonhosted.org/packages/0a/02/4ab2d4c4a1fcb3388b476c67275018e627396cb9865535771f574f043da8/xsdata_attrs-24.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5acb449af0758e06db8f00ea040cfee25d3b28ba8e63ca1411b6604d777d5ee3",
                "md5": "8ea846cc1c609d1680bcdbcef4f9b894",
                "sha256": "8823fe4c42aa1387be00936051cb4a58f28328cd50ccf5592b505d9629fa9720"
            },
            "downloads": -1,
            "filename": "xsdata_attrs-24.5.tar.gz",
            "has_sig": false,
            "md5_digest": "8ea846cc1c609d1680bcdbcef4f9b894",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 17656,
            "upload_time": "2024-05-08T17:20:27",
            "upload_time_iso_8601": "2024-05-08T17:20:27.590752Z",
            "url": "https://files.pythonhosted.org/packages/5a/cb/449af0758e06db8f00ea040cfee25d3b28ba8e63ca1411b6604d777d5ee3/xsdata_attrs-24.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 17:20:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tefra",
    "github_project": "xsdata-attrs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xsdata-attrs"
}
        
Elapsed time: 0.23136s