from csv import reader


def parse_csv(filep):
    """Parse csv file and return dict containing site code to
    bandwidth mappings
    Keyword Arguments:
    filep -- file path to csv file
    """

    bw_map = dict()

    with open(filep, 'r') as csvfile:
        bw_reader = reader(csvfile, delimiter=',', dialect='excel', skipinitialspace=True)
        for row in bw_reader:
            sn = row[1]
            nm = row[2]
            bw = row[0]
            mt = row[3]
            bw_map[sn] = [bw, nm, mt]

    csvfile.close()
    return bw_map