def dictlist_to_dict(dictlist, key):
    """turn a list of dicts with a common key into a dict. values
    of the key should be unique within the dictlist

    Example
    -------
    >>>dict_list = [{"id":"a"}, {"id":"b"}]
    >>>dictlist_to_dict(dict_list, "id")
    {'a': {'id': 'a'}, 'b': {'id': 'b'}}

    """
    result = {}
    for dct in dictlist:
        k = dct[key]
        result[k] = dct
    return result