import csv


def read_pinout_csv(csv_file, keyname="number"):
    """
    read a csv file and return a dict with the given keyname as the keys
    """
    reader = csv.DictReader(open(csv_file))
    lst = []
    for row in reader:
        lst.append(row)
    d = {}
    for item in lst:
        d[item[keyname]] = item
    return d