robot.utils.normalizing
¶
normalize
¶
normalize(
string: str,
ignore: Sequence[str] = (),
caseless: bool = True,
spaceless: bool = True,
) -> str
Normalize the string according to the given spec.
By default, string is turned to lower case (actually case-folded) and all
whitespace is removed. Additional characters can be removed by giving them
in ignore list.
Source code in src/robot/utils/normalizing.py
NormalizedDict
¶
NormalizedDict(
initial: (
Mapping[str, V] | Iterable[tuple[str, V]] | None
) = None,
ignore: Sequence[str] = (),
caseless: bool = True,
spaceless: bool = True,
)
Bases: MutableMapping[str, V]
Custom dictionary implementation automatically normalizing keys.
Initialized with possible initial value and normalizing spec.
Initial values can be either a dictionary or an iterable of name/value pairs.
Normalizing spec has exact same semantics as with the :func:normalize
function.