Skip to content

converter

Convert json or dict to Python objects.

converter = make_converter() module-attribute

cattrs converter to read JSON document or dict to Python objects.

Percentage = float

Type alias for percentage values (0.0-100.0).

PositiveInt = int

Type alias for positive integer values (>= 0).

Ratio = float

Type alias for ratio values (0.0-1.0).

positive_int_hook(val, _)

Cattrs hook to validate positive integer values.

ratio_hook(val, _)

Cattrs hook to validate ratio values.