def key_by(items, key):
    """
    Index a list of dicts by the value of given key.
    Returns a dict of the values. One item per key.
    """
    index = {}
    for item in items:
        _item_key = item[key] if isinstance(item[key], int) else str(item[key]).lower()
        index[_item_key] = item
    return index