ska_src_api_global_execution.service.utils

Utility functions for the Ska Source API Compute service.

Module Contents

Functions

comma_separate_list(items)

Converts a list of items into a comma-separated string.

get_from_env(name[, default])

Get a value from the environment or return a default.

random_id()

Generate a random ID based on the current timestamp and a random four-digit number.

str_to_bool(value)

Converts a string to a boolean value.

str_to_int(value[, default_value])

Converts a string to an integer value.

str_to_int_without_default(value)

Converts a string to an integer value.

Attributes

logger

ska_src_api_global_execution.service.utils.comma_separate_list(items)

Converts a list of items into a comma-separated string.

ska_src_api_global_execution.service.utils.get_from_env(name, default=None)

Get a value from the environment or return a default.

ska_src_api_global_execution.service.utils.logger
ska_src_api_global_execution.service.utils.random_id()

Generate a random ID based on the current timestamp and a random four-digit number.

ska_src_api_global_execution.service.utils.str_to_bool(value)

Converts a string to a boolean value. Accepts ‘true’, ‘false’, ‘1’, ‘0’, and their case-insensitive variants.

ska_src_api_global_execution.service.utils.str_to_int(value, default_value=None)

Converts a string to an integer value. Raises ValueError if the conversion fails.

ska_src_api_global_execution.service.utils.str_to_int_without_default(value)

Converts a string to an integer value. Raises ValueError if the conversion fails.