Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
.. image:: https://static.pepy.tech/personalized-badge/pydantic-xml?period=month&units=international_system&left_color=grey&right_color=orange&left_text=Downloads/month :target: https://pepy.tech/project/pydantic-xml :alt: Downloads/month .. image:: https://github.com/dapper91/pydantic-xml/actions/workflows/test.yml/badge.svg?branch=master :target: https://github.com/dapper91/pydantic-xml/actions/workflows/test.yml :alt: Build status .. image:: https://img.shields.io/pypi/l/pydantic-xml.svg :target: https://pypi.org/project/pydantic-xml :alt: License .. image:: https://img.shields.io/pypi/pyversions/pydantic-xml.svg :target: https://pypi.org/project/pydantic-xml :alt: Supported Python versions .. image:: https://codecov.io/gh/dapper91/pydantic-xml/branch/master/graph/badge.svg :target: https://codecov.io/gh/dapper91/pydantic-xml :alt: Code coverage .. image:: https://readthedocs.org/projects/pydantic-xml/badge/?version=stable&style=flat :alt: ReadTheDocs status :target: https://pydantic-xml.readthedocs.io
pydantic-xml
is a pydantic <https://docs.pydantic.dev>
_ extension providing model fields xml binding
and xml serialization / deserialization.
It is closely integrated with pydantic
which means it supports most of its features.
Dict
, TypedDict
, List
, Set
, Tuple
, ...)Union
type supportgeneric models <https://docs.pydantic.dev/latest/usage/models/#generic-models>
_ supportcomputed fields <https://docs.pydantic.dev/latest/usage/computed_fields/>
_ supportlxml <https://lxml.de/>
_ xml parser supportxml.etree.ElementTree
standard library xml parser supportWhat is not supported?
dataclasses <https://docs.pydantic.dev/usage/dataclasses/>
_callable discriminators <https://docs.pydantic.dev/latest/concepts/unions/#discriminated-unions-with-callable-discriminator>
_The following model fields binding:
.. code-block:: python
class Product(BaseXmlModel): status: Literal['running', 'development'] = attr() # extracted from the 'status' attribute launched: Optional[int] = attr(default=None) # extracted from the 'launched' attribute title: str # extracted from the element text
class Company(BaseXmlModel): trade_name: str = attr(name='trade-name') # extracted from the 'trade-name' attribute website: HttpUrl = element() # extracted from the 'website' element text products: List[Product] = element(tag='product', default=[]) # extracted from the 'Company' element's children
defines the XML document:
.. code-block:: xml
https://www.spacex.com Several launch vehicles Starlink StarshipSee documentation <https://pydantic-xml.readthedocs.io>
_ for more details.
FAQs
pydantic xml extension
We found that pydantic-xml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.