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)[source]

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)[source]

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()[source]

Return an iterator of (validator_name, validator) pairs.

staticconf.validation.validate_any(value)[source]
staticconf.validation.validate_bool(value)[source]
staticconf.validation.validate_date(value)[source]
staticconf.validation.validate_datetime(value)[source]
staticconf.validation.validate_float(value)[source]
staticconf.validation.validate_int(value)[source]
staticconf.validation.validate_list(value)[source]
staticconf.validation.validate_log_level(value)[source]

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

staticconf.validation.validate_numeric(type_func, value)[source]
staticconf.validation.validate_regex(value)[source]
staticconf.validation.validate_set(value)[source]
staticconf.validation.validate_string(value)[source]
staticconf.validation.validate_time(value)[source]
staticconf.validation.validate_tuple(value)[source]