def change_list_to_dict(list_to_convert, key):
    """
    Changes a list into a dictionary using the 'key' parameter as the dictionary keyself.

    Assumes the key is in each dictionary.

    Assumes the key is unique.
    """

    dict_to_export = {}

    for each_obj_in_list in list_to_convert:

        # Check if key already exists in dictionary.
        if key in dict_to_export.keys():
            raise Exception(f"This key name is not unique.")

        dict_to_export[each_obj_in_list[key]] = each_obj_in_list

    return dict_to_export