akkudoktoreos.server.dash.configuration.get_nested_value
- akkudoktoreos.server.dash.configuration.get_nested_value(dictionary: Dict[str, Any] | List[Any], keys: Sequence[str | int], default: T | None = None) Any | T
Retrieve a nested value from a dictionary or list using a sequence of keys.
- Parameters:
dictionary (Union[Dict[str, Any], List[Any]]) – The nested dictionary or list to search.
keys (Sequence[Union[str, int]]) – A sequence of keys or indices representing the path to the desired value.
default (Optional[T]) – A value to return if the path is not found.
- Returns:
The value at the specified nested path, or the default value if not found.
- Return type:
Union[Any, T]
- Raises:
TypeError – If the input is not a dictionary or list, or if keys are not a sequence.
KeyError – If a key is not found in a dictionary.
IndexError – If an index is out of range in a list.