import csv


def read_csv(csvfile):
    """
    Read CSV file and index by the unique id.
    """
    index = {}
    with open(csvfile, 'r') as data:
        for row in csv.DictReader(data):
            index[row['id']] = row

    return index