Other
rigour.units
normalize_unit(unit)
Normalize a unit string to its standard abbreviation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unit
|
str
|
The unit string to normalize. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The normalized unit abbreviation. |
Source code in rigour/units.py
rigour.boolean
bool_text(value)
Convert a boolean value to a string representation. If the input is None, it returns None. If the input is True, it returns 't'. If the input is False, it returns 'f'.
Source code in rigour/boolean.py
text_bool(text)
cached
Convert a string representation of a boolean value to a boolean. If the input is None or an empty string, it returns None.
Source code in rigour/boolean.py
rigour.env
env_bool(name, default)
Ensure the env returns a boolean.