The validation.py module#

Summary#

check_percentage

Check that a value is a percentage expressed between 0 and 100.

Description#

Shared numeric, collection, and path validation helpers.

Module detail#

validation.check_percentage(name, value)#

Check that a value is a percentage expressed between 0 and 100.

Parameters:
namestr

Name of the checked value, used in the error message.

valuefloat

Value to check.

Raises:
ValueError

If value is not within [0, 100].