{"id":15441991,"url":"https://github.com/dapper91/pydantic-xml","last_synced_at":"2025-05-15T06:09:00.027Z","repository":{"id":57750903,"uuid":"485920991","full_name":"dapper91/pydantic-xml","owner":"dapper91","description":"python xml for humans","archived":false,"fork":false,"pushed_at":"2025-03-29T08:03:56.000Z","size":414,"stargazers_count":189,"open_issues_count":20,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T11:12:44.686Z","etag":null,"topics":["deserialization","lxml","parser","pydantic","python","serialization","xml"],"latest_commit_sha":null,"homepage":"https://pydantic-xml.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dapper91.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-26T19:28:39.000Z","updated_at":"2025-04-11T00:31:47.000Z","dependencies_parsed_at":"2023-02-18T22:15:55.208Z","dependency_job_id":"a3508dab-9238-4737-9708-20daea612d83","html_url":"https://github.com/dapper91/pydantic-xml","commit_stats":{"total_commits":196,"total_committers":10,"mean_commits":19.6,"dds":"0.061224489795918324","last_synced_commit":"b309d04e351007cd0cb01808d33f23d4c33d6069"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapper91%2Fpydantic-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapper91%2Fpydantic-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapper91%2Fpydantic-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapper91%2Fpydantic-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dapper91","download_url":"https://codeload.github.com/dapper91/pydantic-xml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254283350,"owners_count":22045141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deserialization","lxml","parser","pydantic","python","serialization","xml"],"created_at":"2024-10-01T19:24:44.237Z","updated_at":"2025-05-15T06:08:59.964Z","avatar_url":"https://github.com/dapper91.png","language":"Python","readme":"\npydantic-xml extension\n======================\n\n.. image:: https://static.pepy.tech/personalized-badge/pydantic-xml?period=month\u0026units=international_system\u0026left_color=grey\u0026right_color=orange\u0026left_text=Downloads/month\n    :target: https://pepy.tech/project/pydantic-xml\n    :alt: Downloads/month\n.. image:: https://github.com/dapper91/pydantic-xml/actions/workflows/test.yml/badge.svg?branch=master\n    :target: https://github.com/dapper91/pydantic-xml/actions/workflows/test.yml\n    :alt: Build status\n.. image:: https://img.shields.io/pypi/l/pydantic-xml.svg\n    :target: https://pypi.org/project/pydantic-xml\n    :alt: License\n.. image:: https://img.shields.io/pypi/pyversions/pydantic-xml.svg\n    :target: https://pypi.org/project/pydantic-xml\n    :alt: Supported Python versions\n.. image:: https://codecov.io/gh/dapper91/pydantic-xml/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/dapper91/pydantic-xml\n    :alt: Code coverage\n.. image:: https://readthedocs.org/projects/pydantic-xml/badge/?version=stable\u0026style=flat\n   :alt: ReadTheDocs status\n   :target: https://pydantic-xml.readthedocs.io\n\n\n``pydantic-xml`` is a `pydantic \u003chttps://docs.pydantic.dev\u003e`_ extension providing model fields xml binding\nand xml serialization / deserialization.\nIt is closely integrated with ``pydantic`` which means it supports most of its features.\n\n\nFeatures\n--------\n\n- pydantic v1 / v2 support\n- flexable attributes, elements and text binding\n- python collection types support (``Dict``, ``TypedDict``, ``List``, ``Set``, ``Tuple``, ...)\n- ``Union`` type support\n- pydantic `generic models \u003chttps://docs.pydantic.dev/latest/usage/models/#generic-models\u003e`_ support\n- pydantic `computed fields \u003chttps://docs.pydantic.dev/latest/usage/computed_fields/\u003e`_ support\n- `lxml \u003chttps://lxml.de/\u003e`_ xml parser support\n- ``xml.etree.ElementTree`` standard library xml parser support\n\nWhat is not supported?\n______________________\n\n- `dataclasses \u003chttps://docs.pydantic.dev/usage/dataclasses/\u003e`_\n- `callable discriminators \u003chttps://docs.pydantic.dev/latest/concepts/unions/#discriminated-unions-with-callable-discriminator\u003e`_\n\nGetting started\n---------------\n\nThe following model fields binding:\n\n.. code-block:: python\n\n   class Product(BaseXmlModel):\n       status: Literal['running', 'development'] = attr()  # extracted from the 'status' attribute\n       launched: Optional[int] = attr(default=None)  # extracted from the 'launched' attribute\n       title: str  # extracted from the element text\n\n\n   class Company(BaseXmlModel):\n       trade_name: str = attr(name='trade-name')  # extracted from the 'trade-name' attribute\n       website: HttpUrl = element()  # extracted from the 'website' element text\n       products: List[Product] = element(tag='product', default=[])  # extracted from the 'Company' element's children\n\ndefines the XML document:\n\n.. code-block:: xml\n\n   \u003cCompany trade-name=\"SpaceX\"\u003e\n       \u003cwebsite\u003ehttps://www.spacex.com\u003c/website\u003e\n       \u003cproduct status=\"running\" launched=\"2013\"\u003eSeveral launch vehicles\u003c/product\u003e\n       \u003cproduct status=\"running\" launched=\"2019\"\u003eStarlink\u003c/product\u003e\n       \u003cproduct status=\"development\"\u003eStarship\u003c/product\u003e\n   \u003c/Company\u003e\n\n\nSee `documentation \u003chttps://pydantic-xml.readthedocs.io\u003e`_ for more details.\n","funding_links":[],"categories":["Utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapper91%2Fpydantic-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdapper91%2Fpydantic-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapper91%2Fpydantic-xml/lists"}