shared_libraries.utils#

Shared helper functions.

Functions#

ensure_uuid(→ uuid.UUID | None)

Ensure that the input is a UUID or None.

calc_age_from_date(→ int)

Calculate age in years from a given birth date.

Module Contents#

shared_libraries.utils.ensure_uuid(val: str | uuid.UUID | None) → uuid.UUID | None#

Ensure that the input is a UUID or None.

shared_libraries.utils.calc_age_from_date(birth_date: datetime.date) → int#

Calculate age in years from a given birth date.

Parameters:

birth_date – Date of birth

Return type:

Age in years as int