import csv


def parse_gtfs_file(raw_file, key_column):
    """Parse a GTFS file, with key column being the unique key"""
    parse_info = {}

    reader = csv.DictReader(raw_file.splitlines())
    for row in reader:
        # Get the key value
        key_val = row[key_column]
        parse_info[key_val] = {}

        # Loop through the rest
        for row_key in row:
            parse_info[key_val][row_key] = row[row_key]
    return parse_info