mh_utils.utils¶
General utility functions.
Functions:
|
Returns |
|
Convert |
|
Returns the boolean representation of |
|
Construct a timedelta from a value in minutes. |
|
Returns |
-
as_path(val)[source]¶ Returns
valas aPureWindowsPath, orNoneif the value is empty/None/False.- Parameters
val (
Any) – The value to convert to a path- Return type
-
element_to_bool(val)[source]¶ Returns the boolean representation of
val.Values of
-1are counted asTruefor the purposes of this function.Truevalues are'y','yes','t','true','on','1',1,-1, and'-1'.Falsevalues are'n','no','f','false','off','0', and0.- Raises
ValueErrorif ‘val’ is anything else.- Return type