pyxsd.introspection =================== .. py:module:: pyxsd.introspection .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: pyxsd.introspection.COMPONENT_KINDS Classes ------- .. autoapisummary:: pyxsd.introspection.FacetDescription pyxsd.introspection.WildcardDescription pyxsd.introspection.ParticleDescription pyxsd.introspection.MemberDescription pyxsd.introspection.IdentityDescription pyxsd.introspection.ComponentDescription pyxsd.introspection.SchemaDescription Functions --------- .. autoapisummary:: pyxsd.introspection.describe_schema pyxsd.introspection.describe_component pyxsd.introspection.find_components pyxsd.introspection.related_components Module Contents --------------- .. py:data:: COMPONENT_KINDS .. py:class:: FacetDescription An effective facet; patterns retain AND-of-OR restriction groups. .. py:attribute:: name :type: str .. py:attribute:: value :type: Any .. py:attribute:: representation :type: str :value: 'value' .. py:class:: WildcardDescription A wildcard's effective namespace and validation policy. .. py:attribute:: namespace :type: str .. py:attribute:: process_contents :type: str .. py:attribute:: target_namespace :type: str | None .. py:attribute:: not_namespace :type: tuple[str, ...] .. py:attribute:: not_qname :type: tuple[str, ...] .. py:class:: ParticleDescription A compiled particle, including group boundaries and declaration links. .. py:attribute:: kind :type: str .. py:attribute:: min_occurs :type: int .. py:attribute:: max_occurs :type: int | None .. py:attribute:: component_id :type: str | None .. py:attribute:: children :type: tuple[ParticleDescription, ...] .. py:attribute:: wildcard :type: WildcardDescription | None :value: None .. py:attribute:: open_content :type: bool :value: False .. py:class:: MemberDescription An XML member, accessor and type; particle trees govern group constraints. .. py:attribute:: kind :type: str .. py:attribute:: xml_name :type: str .. py:attribute:: python_name :type: str .. py:attribute:: python_type :type: str .. py:attribute:: component_id :type: str | None .. py:attribute:: min_occurs :type: int .. py:attribute:: max_occurs :type: int | None .. py:attribute:: default :type: str | None .. py:attribute:: fixed :type: str | None .. py:attribute:: nillable :type: bool .. py:attribute:: use :type: str | None .. py:attribute:: facets :type: tuple[FacetDescription, ...] .. py:attribute:: occurrence_precision :type: Literal['exact', 'conservative'] :value: 'conservative' .. py:class:: IdentityDescription An authored key, unique or keyref, without claiming XPath equivalence. .. py:attribute:: kind :type: str .. py:attribute:: name :type: str | None .. py:attribute:: selector :type: str | None .. py:attribute:: fields :type: tuple[str, ...] .. py:attribute:: refer :type: str | None .. py:class:: ComponentDescription One declaration with native constraints and generated binding metadata. .. py:attribute:: id :type: str .. py:attribute:: kind :type: str .. py:attribute:: name :type: str | None .. py:attribute:: namespace :type: str | None .. py:attribute:: global_declaration :type: bool .. py:attribute:: location :type: pyxsd.locations.IssueLocation | None .. py:attribute:: owner_id :type: str | None .. py:attribute:: python_name :type: str | None .. py:attribute:: python_type :type: str | None .. py:attribute:: members :type: tuple[MemberDescription, ...] .. py:attribute:: particle :type: ParticleDescription | None .. py:attribute:: facets :type: tuple[FacetDescription, ...] .. py:attribute:: assertions :type: tuple[str, ...] .. py:attribute:: default :type: str | None .. py:attribute:: fixed :type: str | None .. py:attribute:: nillable :type: bool .. py:attribute:: mixed :type: bool .. py:attribute:: derivation :type: str | None .. py:attribute:: base_types :type: tuple[str, ...] .. py:attribute:: substitution_group :type: str | None .. py:attribute:: attribute_wildcard :type: WildcardDescription | None .. py:attribute:: documentation :type: str | None .. py:attribute:: identity_constraints :type: tuple[IdentityDescription, ...] .. py:class:: SchemaDescription A deterministic schema inventory; roots are global element IDs. .. py:attribute:: target_namespace :type: str | None .. py:attribute:: roots :type: tuple[str, ...] .. py:attribute:: components :type: tuple[ComponentDescription, ...] .. py:function:: describe_schema(schema) Return the native inventory, without requiring schema validity. .. py:function:: describe_component(schema, component_id) Return one exact declaration, raising KeyError for an unknown ID. .. py:function:: 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. .. py:function:: related_components(schema, component_id, *, direction, depth) Breadth-first declaration traversal, excluding the seed and duplicates.