swh.model.fields.simple module

swh.model.fields.simple.validate_type(value, type)[source]

Validate that value is an integer

swh.model.fields.simple.validate_int(value)[source]

Validate that the given value is an int

swh.model.fields.simple.validate_str(value)[source]

Validate that the given value is a string

swh.model.fields.simple.validate_bytes(value)[source]

Validate that the given value is a bytes object

swh.model.fields.simple.validate_datetime(value)[source]

Validate that the given value is either a datetime, or a numeric number of seconds since the UNIX epoch.

swh.model.fields.simple.validate_enum(value, expected_values)[source]

Validate that value is contained in expected_values