sambuca_core.utility¶
Sambuca_Core utility code module
Collections¶
Operating system-specific utility functions.
-
sambuca_core.utility.collections.merge_dictionary(target, new_items)[source]¶ Merges a dictionary into the master set, warning when a duplicate name is detected. Keys from new_items that are already present in target will generate warnings without modifying target.
And yes, I know there are builtin methods to merge dictionaries (update), but I wanted finer control over handling for existing keys.
Parameters: - target (dictionary) – The destination dictionary.
- new_items (dictionary) – The dictionary of new items to merge.
Returns: target, with all unique items merged from new items.
Return type: dict
Numpy¶
Numpy-specific utility functions.
OS¶
Operating system-specific utility functions.
-
sambuca_core.utility.os.list_files(directory, extensions=None)[source]¶ Get a list of files in a directory, filtered by an optional list of extensions.
Parameters: - directory (str) – The directory to list.
- extensions (list) – Optional list of file extensions.
Returns: The list of matching file info objects.
Return type: list