Component introspection
Frozen metadata records for component catalogs, schemas, assets, and extensions.
ComponentCatalog class
Hold one immutable, versioned snapshot of registered component metadata.
Attributes
schema_versionint- The core component-catalog schema version.citry_versionstr- Installed Citry package version used for the snapshot.engine_idstr- Runtime identity of the inspected Citry instance.extension_versionstuple[ExtensionVersion, ...]- Requested extension metadata versions, sorted by name.componentstuple[ComponentInfo, ...]- Component records in canonical catalog order.
to_json function
Serialize this catalog to deterministic UTF-8 JSON text.
Parameters
indentint | None- Optional non-negative indentation width. ``None`` emits compact JSON.
Returns
str: Deterministic JSON with recursively sorted object keys and Unicode
Raises
TypeError- If ``indent`` is not an integer or ``None``.ValueError- If ``indent`` is negative.
ComponentInfo class
Describe one exact registered component class generation.
Attributes
class_idstr- Stable import-derived component route identity.engine_idstr- Runtime identity of the owning Citry instance.definition_idstr- Runtime identity of this exact class generation.namestr- Deterministically selected primary registration name.aliasestuple[str, ...]- Other registration names for the same class.class_namestr | None- Python class name, when available.modulestr | None- Python module name, when available.qualnamestr | None- Python qualified class name, when available.import_pathstr | None- Full Python import path, when available.python_filePath | None- Absolute already-loaded module file, when available.descriptionstr | None- The component class's own cleaned docstring.transparentbool- Whether the component joins its parent's serialization frame.builtinbool- Whether Citry created this as a framework component.schemasComponentSchemas- The component's five effective typed schemas.assetsComponentAssets- The component's three primary asset declarations.extensionstuple[ComponentExtensionInfo, ...]- Explicitly requested extension-owned metadata.
ComponentIntrospectionContext class
Give one extension the inputs for an explicitly requested metadata query.
The component class is temporary live runtime state. Inspectors publish copied JSON metadata and must not retain this context or the class.
Attributes
citryCitry- The owning Citry instance.component_classtype[Component]- The live class from the query's copied registry snapshot.infoComponentInfo- The complete core metadata record, with no extension entries.
component_class attribute
The temporary live component class from the copied registry snapshot.
info attribute
info: ComponentInfoThe already-built core metadata record, with no extension entries.
ComponentIntrospectionError class
Bases: RuntimeError
Report that a requested extension could not publish component metadata.
Attributes
extension_name- The installed or requested extension name.component_name- The component's primary registered name, when the failure happened while inspecting one component.
ComponentSchemas class
Group the five typed schema roles exposed by a component.
Attributes
kwargsSchemaInfo- Inputs accepted as component keyword arguments.slotsSchemaInfo- Slot fills accepted by the component.template_dataSchemaInfo- Values returned for template rendering.js_dataSchemaInfo- Values made available to component JavaScript.css_dataSchemaInfo- Values made available to component CSS.
SchemaInfo class
Describe one effective component schema binding.
Attributes
kindLiteral['absent', 'fields', 'opaque']- Whether the schema is absent, recognized as fields, or opaque.declared_onstr | None- Import path of the MRO class that supplied the binding.import_pathstr | None- Import path of the effective schema class.fieldstuple[FieldInfo, ...]- Recognized fields in runtime declaration order.
FieldInfo class
Describe one field in a recognized component schema.
Attributes
namestr- The schema adapter's canonical field name.requiredbool- Whether callers must provide the field.type_displaystr | None- A safe normalized type string, when available.type_fidelityLiteral['normalized', 'unavailable']- Whether ``type_display`` contains a normalized type.default_kindLiteral['missing', 'value', 'factory']- Whether the field has no default, a value, or a factory.default_value_stateLiteral['not-applicable', 'omitted', 'available', 'unsupported']- Whether a real default value was requested and copied.default_valueFrozenJsonValue | None- A recursively frozen portable default, when available.descriptionstr | None- Runtime field documentation from a supported schema source.
default_value_state attribute
default_value_state: Literal['not-applicable', 'omitted', 'available', 'unsupported'] ComponentAssets class
AssetInfo class
Describe one primary template, JavaScript, or CSS declaration.
Attributes
kindLiteral['none', 'inline', 'file']- Whether the asset is absent, inline, or file-backed.declared_onstr | None- Import path of the class that supplied the declaration.owner_filePath | None- Absolute Python file containing the declaring class.declared_pathstr | None- The file path exactly as declared by the component.resolutionLiteral['not-applicable', 'not-requested', 'resolved', 'missing', 'unavailable']- Whether path resolution was requested and what it found.resolved_pathPath | None- Absolute existing asset path when resolution succeeded.searched_pathstuple[Path, ...]- Absolute candidate paths checked during resolution.
resolution attribute
resolution: Literal['not-applicable', 'not-requested', 'resolved', 'missing', 'unavailable'] ExtensionVersion class
ComponentExtensionInfo class
Store one extension's explicitly published component metadata.
Attributes
namestr- The extension's unique registered name.introspection_versionint- The extension-owned positive schema version.dataFrozenJsonObject- A defensively copied and recursively frozen JSON object.
NestedClassDeclaration class
One nested class binding written on a component or definition base.
Attributes
declaring_classtype- The class whose body contains the binding.namestr- The nested declaration name, such as ``"Events"``.valueobject- The exact authored value. Supported declarations use a class, while ``None`` explicitly resets inherited declarations.