raplan.utils
¶
RaPlan utilities.
convert_pascal_str
¶
Convert cased input string to a uniform representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
Input string to convert. |
required |
space
|
str
|
Character to use as a space. |
'_'
|
lowercase
|
bool
|
Whether to enforce lowercase output. |
True
|
Source code in src/raplan/utils.py
datetime_to_float_years
¶
Convert a datetime to a float.
Source code in src/raplan/utils.py
days_in_year
¶
deterministic_uuidv4_from_set
¶
Calculate a deterministic UUIDv4 for a collection of UUID's.
Source code in src/raplan/utils.py
deterministic_uuidv5_from_hashes
¶
deterministic_uuidv5_from_hashes(
*objects: Hashable,
) -> UUID
Calclate a deterministic UUIDv5 for hashable objects.
Source code in src/raplan/utils.py
float_years_to_datetime
¶
Convert a float of years into a datetime object (rounded down to given precision).
Source code in src/raplan/utils.py
gen_dataclass_columns
¶
gen_dataclass_columns(cls) -> Generator[str, None, None]
Yield fields and subfields from a class or object.
Source code in src/raplan/utils.py
gen_dataclass_types
¶
Yield fields and subfields from a class or object.
Source code in src/raplan/utils.py
gen_dataclass_values
¶
Yield all field and sub-field values in order of their dataclass field definition.
Source code in src/raplan/utils.py
gen_enum_collection_columns
¶
gen_enum_collection_columns(
cls,
) -> Generator[str, None, None]
Column names for toggles for an Enum.