class_util

Utilities to support HED validation.

Functions

find_invalid_positions(s, pattern)

is_clock_face_time(time_string)

Check if a valid HH:MM time string.

is_date_time_value_class(date_time_string)

Check if the specified string is a valid datetime.

is_name_value_class(name_str)

is_numeric_value_class(numeric_string)

Check to see if valid numeric value.

is_text_value_class(text_string)

Placeholder for eventual text value class validation.

find_invalid_positions(s, pattern)[source]
is_clock_face_time(time_string)[source]

Check if a valid HH:MM time string.

Parameters:

time_string (str) – A time string.

Returns:

True if the time string is valid. False, if otherwise.

Return type:

bool

Notes

  • This is deprecated and has no expected use going forward.

is_date_time_value_class(date_time_string)[source]

Check if the specified string is a valid datetime.

Parameters:

date_time_string (str) – A datetime string.

Returns:

True if the datetime string is valid. False, if otherwise.

Return type:

bool

Notes

  • ISO 8601 datetime string.

is_name_value_class(name_str)[source]
is_numeric_value_class(numeric_string)[source]

Check to see if valid numeric value.

Parameters:

numeric_string (str) – A string that should be only a number with no units.

Returns:

True if the numeric string is valid. False, if otherwise.

Return type:

bool

is_text_value_class(text_string)[source]

Placeholder for eventual text value class validation.

Parameters:

text_string (str) – Text class.

Returns:

True

Return type:

bool

Classes

UnitValueValidator([...])

Validates units.