Components

pydantic model infrasys.component.Component

Base class for all models representing entities that get attached to a System.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Component",
   "description": "Base class for all models representing entities that get attached to a System.",
   "type": "object",
   "properties": {
      "uuid": {
         "format": "uuid",
         "title": "Uuid",
         "type": "string"
      },
      "name": {
         "title": "Name",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "name"
   ]
}

Config:
  • str_strip_whitespace: bool = True

  • validate_assignment: bool = True

  • validate_default: bool = True

  • extra: str = forbid

  • use_enum_values: bool = False

  • arbitrary_types_allowed: bool = True

  • populate_by_name: bool = True

Fields:
field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, frozen=True)] [Required]
check_component_addition() None

Perform checks on the component before adding it to a system.

model_dump_custom(*args, **kwargs) dict[str, Any]

Custom serialization for this package

pprint()