Utils
- class utils.CaseInsensitiveDict(*args, **kwargs)
Bases:
dict- get(key, default=None, pprint=True)
Return the value for key if key is in the dictionary, else default.
- utils.check_row_exist(dataframe, unique_column, unique_value)
Check if a row exist with given unique value
- Parameters:
dataframe (Pandas DataFrame) – metadata dataframe that must be checked
unique_value (string) – value that can be used to uniquely identifies a row
- Returns:
row index of the row identified with the unique value, or -1 if there is no row corresponding to the unique value
- Return type:
int
- Raises:
ValueError – if more than one row can be identified with given unique value
- utils.find_col_element(element, metadata)
- utils.get_sub_folder_paths_in_folder(folder_path)
get sub folder paths in a folder :param folder_path: the parent folder path :type folder_path: str :return: list
- utils.remove_spaces_and_lower(s)
- Parameters:
s (str) – the str need to deal with
- Returns:
a str with lower case and without space, and _
- utils.validate_metadata_file(metadata_file, version='2.0.0')
- utils.validate_sub_sam_name(validate_str, validate_type)