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
val
as aPureWindowsPath
, orNone
if 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
-1
are counted asTrue
for the purposes of this function.True
values are'y'
,'yes'
,'t'
,'true'
,'on'
,'1'
,1
,-1
, and'-1'
.False
values are'n'
,'no'
,'f'
,'false'
,'off'
,'0'
, and0
.- Raises
ValueError
if ‘val’ is anything else.- Return type
-
make_timedelta
(minutes)[source] Construct a timedelta from a value in minutes.
Changed in version 0.1.0: Moved from
mh_utils.cef_parser
.