pyxsd.integrations.projection

Dependency-free specifications for named contextual scalar columns.

Classes

FieldSource

Select a scalar or attribute by expanded XML names, relative to a row.

Functions

field_source_metadata(source)

Serialize one source without adding unset RELAX NG selectors.

Module Contents

class pyxsd.integrations.projection.FieldSource

Select a scalar or attribute by expanded XML names, relative to a row.

scope: Literal['record', 'ancestor', 'root'] = 'record'
path: tuple[str, ...] = ()
attribute: str | None = None
levels: int = 0
datatype: tuple[str, str] | None = None
candidate_id: str | None = None
pyxsd.integrations.projection.field_source_metadata(source)

Serialize one source without adding unset RELAX NG selectors.

The leading key order matches the historical dataclasses.asdict output, so existing XSD pyxsd:source metadata stays byte-compatible.

Parameters:

source (FieldSource)

Return type:

dict[str, object]