pyxsd.introspection¶
Immutable, native schema descriptions independent of optional projections.
Component IDs describe declarations, not generated Python object identities. Descriptions are a snapshot of a compiled schema; compile again after changing schema sources or overlays. Particle trees, rather than member occurrence summaries alone, retain the relationships between choices and repeated groups.
Attributes¶
Classes¶
An effective facet; patterns retain AND-of-OR restriction groups. |
|
A wildcard's effective namespace and validation policy. |
|
A compiled particle, including group boundaries and declaration links. |
|
An XML member, accessor and type; particle trees govern group constraints. |
|
An authored key, unique or keyref, without claiming XPath equivalence. |
|
One declaration with native constraints and generated binding metadata. |
|
A deterministic schema inventory; roots are global element IDs. |
Functions¶
|
Return the native inventory, without requiring schema validity. |
|
Return one exact declaration, raising KeyError for an unknown ID. |
|
Filter by literal case-insensitive text, component kind and namespace. |
|
Breadth-first declaration traversal, excluding the seed and duplicates. |
Module Contents¶
- pyxsd.introspection.COMPONENT_KINDS¶
- class pyxsd.introspection.FacetDescription¶
An effective facet; patterns retain AND-of-OR restriction groups.
- value: Any¶
- class pyxsd.introspection.WildcardDescription¶
A wildcard’s effective namespace and validation policy.
- class pyxsd.introspection.ParticleDescription¶
A compiled particle, including group boundaries and declaration links.
- children: tuple[ParticleDescription, ...]¶
- wildcard: WildcardDescription | None = None¶
- class pyxsd.introspection.MemberDescription¶
An XML member, accessor and type; particle trees govern group constraints.
- facets: tuple[FacetDescription, ...]¶
- occurrence_precision: Literal['exact', 'conservative'] = 'conservative'¶
- class pyxsd.introspection.IdentityDescription¶
An authored key, unique or keyref, without claiming XPath equivalence.
- class pyxsd.introspection.ComponentDescription¶
One declaration with native constraints and generated binding metadata.
- location: pyxsd.locations.IssueLocation | None¶
- members: tuple[MemberDescription, ...]¶
- particle: ParticleDescription | None¶
- facets: tuple[FacetDescription, ...]¶
- attribute_wildcard: WildcardDescription | None¶
- identity_constraints: tuple[IdentityDescription, ...]¶
- class pyxsd.introspection.SchemaDescription¶
A deterministic schema inventory; roots are global element IDs.
- components: tuple[ComponentDescription, ...]¶
- pyxsd.introspection.describe_schema(schema)¶
Return the native inventory, without requiring schema validity.
- Parameters:
schema (pyxsd.schema.Schema)
- Return type:
- pyxsd.introspection.describe_component(schema, component_id)¶
Return one exact declaration, raising KeyError for an unknown ID.
- Parameters:
schema (pyxsd.schema.Schema)
component_id (str)
- Return type:
- pyxsd.introspection.find_components(schema, *, text=None, kind=None, namespace=None)¶
Filter by literal case-insensitive text, component kind and namespace.
None leaves a filter unrestricted; an empty namespace selects unqualified declarations. No caller expression is evaluated.
- Parameters:
schema (pyxsd.schema.Schema)
text (str | None)
kind (str | None)
namespace (str | None)
- Return type:
Breadth-first declaration traversal, excluding the seed and duplicates.
- Parameters:
schema (pyxsd.schema.Schema)
component_id (str)
direction (Literal['uses', 'used_by'])
depth (int)
- Return type: