Introspection & Validation¶
Runtime helpers for discovering what the SDK exposes and validating
project data — useful from notebooks, IDE plugins, and AI agents
alike. All return typed Pydantic models; call .model_dump() for
JSON-shaped output.
import comcheck_api as cc
# What operation functions does the SDK ship?
for op in cc.list_operations():
print(op.group, op.signature)
# What does the ComBuilding model look like?
schema = cc.lookup_type("ComBuilding")
if schema:
for field in schema.fields:
print(field.name, field.type, field.required)
# Does this dict satisfy the SDK schema?
result = cc.validate_project(project_dict)
if not result.ok:
for err in result.errors:
print(err.loc, err.msg)
Introspection¶
introspection
¶
Introspection helpers over the installed SDK.
Discoverable from the package root:
>>> from comcheck_api import list_operations, lookup_type
>>> ops = list_operations()
>>> schema = lookup_type("ComBuilding")
list_operations enumerates the public functions in the project
operation modules. lookup_type reflects a Pydantic model or enum
from :mod:comcheck_api.types. Both return Pydantic models with
typed fields so IDEs and type checkers can see the shape.
OperationInfo
¶
Bases: BaseModel
One public function in a project-operation module.
FieldSchema
¶
Bases: BaseModel
One field of a Pydantic model.
TypeSchema
¶
Bases: BaseModel
Reflected schema of a Pydantic model or StrEnum.
list_operations
¶
Discover public functions in the project operation modules.
Discovered live via :mod:inspect so the list always matches the
installed SDK version.
Source code in comcheck_api/introspection.py
lookup_type
¶
Reflect a Pydantic model or enum from :mod:comcheck_api.types.
Returns None if no matching type is found. Lookup is
case-insensitive as a fallback.
Source code in comcheck_api/introspection.py
Validation¶
validation
¶
Project-data validation helpers.
Discoverable from the package root:
>>> from comcheck_api import validate_project
>>> result = validate_project(project_data)
>>> if not result.ok:
... for err in result.errors:
... print(err.loc, err.msg)
No network calls. Validates against the SDK's ComBuilding Pydantic
model.
ValidationError
¶
Bases: BaseModel
One Pydantic validation failure with a dotted location path.
ValidationResult
¶
Bases: BaseModel
Outcome of validating a project against ComBuilding.
validate_project
¶
Validate data against the :class:ComBuilding Pydantic model.
Accepts a dict or an existing ComBuilding (round-trips through
model_dump so the same code path runs in both cases).