dapper91 / pydantic-xml

python xml for humans
https://pydantic-xml.readthedocs.io
The Unlicense
141 stars 14 forks source link

Adjacent sub-elements support added. #143

Closed dapper91 closed 7 months ago

dapper91 commented 7 months ago

Adjacent sub-elements support added.

See the example:

<Products>
    <product status="running">Several launch vehicles</product>
    <launched>2013</launched>
    <product status="running">Starlink</product>
    <launched>2019</launched>
    <product status="development">Starship</product>
</Products>
class Product(BaseXmlModel, tag='product'):
    status: str = attr()
    title: str

class Launch(RootXmlModel[int], tag='launched'):
    pass

class Products(RootXmlModel):
    root: List[Tuple[Product, Optional[Launch]]]

For more information see.

codecov-commenter commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (eb8efc0) 91.63% compared to head (a9a3759) 91.79%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #143 +/- ## ========================================== + Coverage 91.63% 91.79% +0.16% ========================================== Files 25 25 Lines 1375 1378 +3 ========================================== + Hits 1260 1265 +5 + Misses 115 113 -2 ``` | [Flag](https://app.codecov.io/gh/dapper91/pydantic-xml/pull/143/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Dmitry+Pershin) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/dapper91/pydantic-xml/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Dmitry+Pershin) | `91.79% <100.00%> (+0.16%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Dmitry+Pershin#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.