mlrl.common.format module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides utility functions for creating textual representations.

mlrl.common.format.format_dict_keys(dictionary: Dict[str, Set[str]]) str

Creates and returns a textual representation of the keys in a dictionary.

Parameters:

dictionary – The dictionary to be formatted

Returns:

The textual representation that has been created

mlrl.common.format.format_enum_values(enum) str

Creates and returns a textual representation of an enum’s values.

Parameters:

enum – The enum to be formatted

Returns:

The textual representation that has been created

mlrl.common.format.format_string_iterable(strings: Iterable[str], separator: str = ', ', delimiter: str = '') str

Creates and returns a textual representation of string in an iterable.

Params strings:

The iterable of strings to be formatted

Parameters:
  • separator – The string that should be used as a separator

  • delimiter – The string that should be added at the beginning and end of each string

Returns:

The textual representation that has been created

mlrl.common.format.format_string_set(strings: Set[str]) str

Creates and returns a textual representation of the strings in a set.

Parameters:

strings – The set of strings to be formatted

Returns:

The textual representation that has been created