loom.core.command¶
- class loom.core.command.CommandAdapter(*args, **kwargs)[source]¶
Bases:
Protocol[RawT]Contract for compiling a Command into a transport-specific schema and parsing raw input into a Command instance.
Implementations translate the Command (single source of truth) into validation schemas for specific transports (Pydantic, Avro, msgspec, etc.).
- Parameters:
RawT – The raw input type the adapter accepts (e.g. dict, bytes).
- compile_schema(command_cls)[source]¶
Compile a Command class into a transport-specific validation schema.
- class loom.core.command.CommandField(calculated=False, internal=False, patch=False, default=UNSET)[source]¶
Bases:
objectMetadata descriptor for command fields.
- loom.core.command.get_calculated_fields(cls)[source]¶
Return
CommandFielddescriptors marked ascalculated.- Parameters:
cls (type) – A Command subclass.
- Returns:
Mapping of field name to
CommandFieldmetadata.- Return type:
- loom.core.command.get_command_fields(cls)[source]¶
Return all
CommandFielddescriptors declared on a command class.- Parameters:
cls (type) – A Command subclass.
- Returns:
Mapping of field name to
CommandFieldmetadata.- Return type:
- loom.core.command.get_input_fields(cls)[source]¶
Return
CommandFielddescriptors that are user-supplied.Excludes fields marked as
internalorcalculated.- Parameters:
cls (type) – A Command subclass.
- Returns:
Mapping of field name to
CommandFieldmetadata.- Return type:
- loom.core.command.get_internal_fields(cls)[source]¶
Return
CommandFielddescriptors marked asinternal.- Parameters:
cls (type) – A Command subclass.
- Returns:
Mapping of field name to
CommandFieldmetadata.- Return type: