smart_data_hub.generate_id

Attributes

yaml

Functions

sdh_namespace()

Generate the SDH namespace UUID.

get_list_from_sequence(value)

helper function to convert a string or None to a list.

normalize_str(val)

Normalize function for splitting and sorting strings.

flatten_entry_dict(property_entry, property_name)

Flatten the entry dictionary.

get_entry_str(property_entry, property_name)

Function for combining all entry fields into a single string.

generate_property_id(yaml_file_path)

Check for missing ID and generate a unique ID for each data in the YAML file.

generate_id_for_all()

Generate IDs for all YAML files in the rock_property directory

Module Contents

smart_data_hub.generate_id.yaml[source]
smart_data_hub.generate_id.sdh_namespace()[source]

Generate the SDH namespace UUID.

Returns:

The SDH namespace UUID.

Return type:

uuid.UUID

smart_data_hub.generate_id.get_list_from_sequence(value)[source]

helper function to convert a string or None to a list.

Parameters:

value (str, None, list) – the input value to convert.

Raises:

ValueError – if the input value is not a string, None, or a list.

Returns:

the converted list.

Return type:

list

smart_data_hub.generate_id.normalize_str(val)[source]

Normalize function for splitting and sorting strings.

Parameters:

val (str) – The input string to normalize.

Returns:

The normalized string.

Return type:

str

smart_data_hub.generate_id.flatten_entry_dict(property_entry, property_name)[source]

Flatten the entry dictionary.

Parameters:
  • property_entry (dict) – The property dictionary.

  • property_name (str) – Property name.

Returns:

The flattened entry dictionary.

Return type:

dict

smart_data_hub.generate_id.get_entry_str(property_entry, property_name)[source]

Function for combining all entry fields into a single string.

Parameters:
  • property_entry (dict) – The property dictionary.

  • property_name (str) – Property name.

Returns:

The combined entry string.

Return type:

str

smart_data_hub.generate_id.generate_property_id(yaml_file_path)[source]

Check for missing ID and generate a unique ID for each data in the YAML file.

Parameters:

yaml_file_path (str) – The path to the YAML file.

smart_data_hub.generate_id.generate_id_for_all()[source]

Generate IDs for all YAML files in the rock_property directory