pydantic-xml
pydantic-xml copied to clipboard
python xml for humans
Digging through the documentation and code, I was unable to figure out if the following was possible, and if so, what the best approach would be. Supposing I had an...
I have model A and model B, discriminated by type field. In pydantic I can use TypeAdapter(A | B).validate_json() to parse A or B. But how I can do the...
Normally pydantic supports [typing.Sequence](https://docs.pydantic.dev/latest/api/standard_library_types/#typingsequence), but it generates an internal error with pydantic_xml: ```python import pydantic_xml as pxml from typing import Sequence class Model(pxml.BaseXmlModel): values: Sequence[int] ``` results in ``` Traceback...
pydantic_xml seems to have an issue with PlainValidator: ```python import datetime as dt import pydantic import pydantic_xml as pxml from typing import Annotated Date = Annotated[ dt.date, pydantic.PlainValidator( lambda v:...
Hi @dapper91 again :blush:, I'm trying to use the lib to parse [HL7 aECG](https://en.wikipedia.org/wiki/HL7_aECG) files. Let's take [this file as an example](https://raw.githubusercontent.com/FDA/aecg-python/refs/heads/main/src/aecg/data/hl7/2003-12%20Schema/example/Example%20aECG.xml). I have the following program: ```python from typing...