import csv


def create_mapping(path, src, dest, key_type=None) -> dict:
    """ Create a dictionary between two attributes. """
    if key_type is None:
        key_type = int

    with open(path, 'r') as f:
        reader = csv.DictReader(f)
        raw_data = [r for r in reader]
        mapping = {key_type(row[src]): row[dest] for row in raw_data}
    return mapping