pyxsd.batch

Sequential parsing of explicitly identified local XML files.

Records are frozen, but a contained Document remains mutable.

Exceptions

BatchParseError

First failed input in raise mode; inspect outcome.

Classes

DocumentSource

Caller label and local path, anchored when constructed.

InputFailure

Expected input failure, without a live exception or traceback.

ParseOutcome

One input's result with a snapshot of its validation issues.

Functions

iter_parse(schema, sources, *[, errors])

Parse in caller order, lazily, without retaining earlier outcomes.

Module Contents

class pyxsd.batch.DocumentSource

Caller label and local path, anchored when constructed.

id: str
path: str | os.PathLike[str]
class pyxsd.batch.InputFailure

Expected input failure, without a live exception or traceback.

kind: Literal['io', 'malformed_xml']
message: str
class pyxsd.batch.ParseOutcome

One input’s result with a snapshot of its validation issues.

source: DocumentSource
status: Literal['valid', 'invalid', 'input_error']
document: pyxsd.document.Document | None
issues: tuple[pyxsd.validation.ValidationIssue, ...]
error: InputFailure | None
exception pyxsd.batch.BatchParseError(outcome)

First failed input in raise mode; inspect outcome.

Parameters:

outcome (ParseOutcome)

outcome
pyxsd.batch.iter_parse(schema, sources, *, errors='raise')

Parse in caller order, lazily, without retaining earlier outcomes.

Configuration and schema checks run on first iteration. Expected input failures stop with BatchParseError by default; report mode yields them. Do not parse concurrently or reentrantly on this Schema.

Parameters:
Return type:

collections.abc.Iterator[ParseOutcome]