graflo.util.casting¶
Safe document field type casting for ingestion resources.
Attributes¶
SAFE_TYPE_CASTERS = {'str': str, 'int': int, 'float': float, 'bool': bool, 'bytes': bytes, 'list': list, 'dict': dict, 'tuple': tuple, 'set': set}
module-attribute
¶
Functions:¶
apply_type_casters(doc, casters)
¶
Apply configured type casters to top-level document fields in place.
Source code in graflo/util/casting.py
resolve_type_caster(name)
¶
Resolve a type caster by name from a strict allowlist.
Source code in graflo/util/casting.py
resolve_type_casters(types)
¶
Resolve declared field types to callables, skipping unknown names.