# Validation

Validate a configuration value by converting it to a specific type.

These functions are used by `staticconf.readers` and `staticconf.schema` to coerce config values to a type.

staticconf.validation.build_list_type_validator(item_validator: Callable[[Any], Any]) → Callable[[Any], List[Any]]

  Return a function which validates that the value is a list of items which are validated using item_validator.

staticconf.validation.build_map_type_validator(item_validator: Callable[[Any], Any]) → Callable[[Any], Dict[Any, Any]]

  Return a function which validates that the value is a mapping of items. The function should return pairs of items that will be passed to the dict constructor.

staticconf.validation.get_validators() → ItemsView[str, Callable[[Any], Any]]

  Return an iterator of (validator_name, validator) pairs.

staticconf.validation.validate_any(value: Any) → Any

staticconf.validation.validate_bool(value: Any) → Optional[bool]

staticconf.validation.validate_date(value: Any) → date

staticconf.validation.validate_datetime(value: Any) → datetime

staticconf.validation.validate_float(value: Any) → float

staticconf.validation.validate_int(value: Any) → float

staticconf.validation.validate_list(value: Any) → List[Any]

staticconf.validation.validate_log_level(value: Any) → int

  Validate a log level from a string value. Returns a constant from the `logging` module.

staticconf.validation.validate_numeric(type_func: Callable[[Any], float], value: Any) → float

staticconf.validation.validate_regex(value: Any) → Pattern[str]

staticconf.validation.validate_set(value: Any) → Set[Any]

staticconf.validation.validate_string(value: Any) → Optional[str]

staticconf.validation.validate_time(value: Any) → time

staticconf.validation.validate_tuple(value: Any) → Tuple[Any, ...]