Utils

Useful functions

Utils

blumycelium.utils.get_hash_key(to_hash: str, prefix=None, suffix=None)[source]

return a hash of to_hash that can serve as a key

blumycelium.utils.get_random_variable_name()[source]

returns a string that can serve as a python variable name

blumycelium.utils.gettime()[source]

return timestamp

blumycelium.utils.getuid()[source]

returns a random id that can serve as a key

blumycelium.utils.inpsect_none_if_exception_or_empty(obj_to_inspect, inspect_fct_name)[source]

runs an inspect function on obj_to_inspect and returns None if the result is empty or returns an exception

blumycelium.utils.legalize_key(key)[source]

returns a string that can serve as a valid key for database