etlplus.ops.validate
etlplus.ops.validate module.
Validate dicts/lists with field rules and documents with external schemas.
This module provides a very small validation primitive that is intentionally runtime-friendly (no heavy schema engines) and pairs with ETLPlus’ JSON-like types. It focuses on clear error messages and predictable behavior.
Highlights
Centralized type map and helpers for clarity and reuse.
Consistent error wording; field and item paths like
[2].email.- Small, focused public API with
validate_field(),validate(), and
validate_schema().
- Small, focused public API with
Examples
>>> rules = {
... 'name': {'required': True, 'type': 'string', 'minLength': 1},
... 'age': {'type': 'integer', 'min': 0},
... }
>>> data = {'name': 'Ada', 'age': 28}
>>> validate(data, rules)['valid']
True
Functions
|
Validate a single value against field rules. |
|
Validate one source document against one external schema. |
|
Validate data against rules. |
Classes
|
Validation rules for a single field. |
|
Validation result for a single field. |
|
Validation result for a complete data structure. |