utils
Attributes¶
logger = structlog.get_logger()
module-attribute
¶
CAMEL_TO_SNAKE_REGEX = re.compile('(?<!^)(?=[A-Z])')
module-attribute
¶
WORD_REGEX_PATTERN = re.compile('[^A-Za-z]+')
module-attribute
¶
SUBCLASS_TYPE = TypeVar('SUBCLASS_TYPE')
module-attribute
¶
Classes¶
Functions¶
is_debug() -> bool
¶
Source code in src/kiara/utils/__init__.py
28 29 30 31 32 33 |
|
is_develop() -> bool
¶
Source code in src/kiara/utils/__init__.py
36 37 38 39 40 41 42 43 44 |
|
is_emscripten() -> bool
¶
Check if we're running in Emscripten / Pyodide environment.
Source code in src/kiara/utils/__init__.py
47 48 49 50 |
|
get_dev_config() -> KiaraDevSettings
¶
Source code in src/kiara/utils/__init__.py
53 54 55 56 |
|
is_jupyter() -> bool
¶
Source code in src/kiara/utils/__init__.py
59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
log_exception(exc: Exception)
¶
Source code in src/kiara/utils/__init__.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
log_message(msg: str, **data)
¶
Source code in src/kiara/utils/__init__.py
113 114 115 |
|
get_auto_workflow_alias(module_type: str, use_incremental_ids: bool = False) -> str
¶
Return an id for a workflow obj of a provided module class.
If 'use_incremental_ids' is set to True, a unique id is returned.
module_type (str): the name of the module type
use_incremental_ids (bool): whether to return a unique (incremental) id
str: a module id
Source code in src/kiara/utils/__init__.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
camel_case_to_snake_case(camel_text: str, repl: str = '_') -> str
¶
Source code in src/kiara/utils/__init__.py
147 148 |
|
to_camel_case(text: str) -> str
¶
Source code in src/kiara/utils/__init__.py
151 152 153 |
|
check_valid_field_names(*field_names) -> List[str]
¶
Check whether the provided field names are all valid.
an iterable of strings with invalid field names
Source code in src/kiara/utils/__init__.py
172 173 174 175 176 177 178 179 180 |
|
find_free_id(stem: str, current_ids: Iterable[str], sep='_') -> str
¶
Find a free var (or other name) based on a stem string, based on a list of provided existing names.
stem (str): the base string to use
current_ids (Iterable[str]): currently existing names
method (str): the method to create new names (allowed: 'count' -- for now)
method_args (dict): prototing_config for the creation method
str: a free name
Source code in src/kiara/utils/__init__.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
first_line(text: str)
¶
Source code in src/kiara/utils/__init__.py
218 219 220 221 222 |
|