util module

vdx_helper.util.datetime_from_string(dt: str) datetime

Converts a date like string to a datetime object.

Parameters:

dt (str) – The string to be converted

Returns:

A datetime in ISO format

Return type:

datetime.datetime

vdx_helper.util.optional_datetime_from_string(dt: Optional[str]) Optional[datetime]

Converts a date like string to a datetime object. If the date is None, then returns None

Parameters:

dt (str, optional) – The string to be converted

Returns:

A datetime in ISO format

Return type:

datetime.datetime, optional

vdx_helper.util.optional_uuid_to_string(uuid_: Optional[UUID]) Optional[str]

Converts a UUID value to a string, which can be None. If that is the case, then None is returned.

Parameters:

uuid (uuid.UUID, optional) – A valid UUID value

Returns:

The UUID value converted to string

Return type:

str, optional

vdx_helper.util.optional_uuids_to_string(uids: Optional[List[UUID]]) Optional[List[str]]

Convert a list of valid UUIDs to string, if the list is given. If not, then return None.

Parameters:

uids (List[uuid.UUID], optional) – List of UUIDs

Returns:

List of the UUID in string format

Return type:

List[str], optional

vdx_helper.util.uuid_to_string(uuid_: UUID) str

Converts a UUID value to a string.

Parameters:

uuid (uuid.UUID) – A valid UUID value

Returns:

The UUID value converted to string

Return type:

str

vdx_helper.util.uuids_to_string(uids: List[UUID]) List[str]

Convert a list of valid UUIDs to string.

Parameters:

uids (List[uuid.UUID]) – List of UUIDs

Returns:

List of the UUID in string format

Return type:

List[str]