vein.validation package¶
Submodules¶
vein.validation.policies module¶
- class vein.validation.policies.LengthValidator(length: int, validate_immediately: bool = True)[source]¶
Bases:
IFlowValidator
- class vein.validation.policies.PydanticValidator(model: BaseModel, validate_immediately: bool = True, transform: bool = False)[source]¶
Bases:
IFlowValidator
- class vein.validation.policies.RangeValidator(min_value: int, max_value: int, validate_immediately: bool = True)[source]¶
Bases:
IFlowValidator
- class vein.validation.policies.RegexValidator(pattern: str, validate_immediately: bool = True)[source]¶
Bases:
IFlowValidator
- class vein.validation.policies.TypeValidator(expected_type: type, validate_immediately: bool = True)[source]¶
Bases:
IFlowValidator
- class vein.validation.policies.URLValidator(validate_immediately: bool = True)[source]¶
Bases:
RegexValidator
vein.validation.validatable module¶
- class vein.validation.validatable.ValidatableMixin[source]¶
Bases:
ABC- add_validator(validator: IFlowValidator) ValidatableMixin[source]¶
- validate(force_live: bool = False)[source]¶
Validate the current flow item and its children.
This method performs validation on the current flow item and its children. If the item is an instance of LiveFlowItem, it uses an MD5 hash to track the state of the item’s value. Validation is only performed if the state has changed or if the force_live parameter is set to True.
Parameters: force_live (bool): If True, forces validation for LiveFlowItem instances
regardless of whether the state has changed. This is useful when a new validator is added and immediate validation is required.
Raises: FlowItemValidationError: If any of the validators fail.
- abstract property value: Any¶