convert_list_of_dict

convert_list_of_dict(list_of_dict: list, key: str, value: str, invert: bool = False) dict[source]

Convert a list of dictionaries to a dictionary with possible inversion.

Parameters:
  • list_of_dict (list) – The list of dictionaries to convert.

  • key (str) – The key.

  • value (str) – The value.

  • invert (bool) – Flag to indicate whether to invert key and value.

Returns:

A dictionary with given keys and values.

Return type:

dict