helpers
This module contains helper functions.
convert_str_or_list_to_list(value: str | list[str]) -> list[str]
Convert a string or a list of strings to a list of strings.
Parameters:
-
value
(str | list[str]
) –The value to be converted.
Returns:
-
list[str]
–A list of strings.
Source code in pyobsidian/helpers.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
has_yaml(content: str) -> bool
Check if the given content has YAML.
Parameters:
-
content
(str
) –The content to be checked.
Returns:
-
bool
–True if the content has YAML, False otherwise.
Source code in pyobsidian/helpers.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
read_file(path: str) -> str
Read the content of a file.
Parameters:
-
path
(str
) –The path of the file to be read.
Returns:
-
str
–The content of the file.
Source code in pyobsidian/helpers.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|