import csv


def import_dict(dict_path):

    """Import a two-column csv file as dictionary

    Parameters
    ----------
    dict_path: str
        path of the csv file 

    Returns
    -------
    dict
        mapping from keys to values
    """

    # Load the index system 
    with open(dict_path, 'r') as file:
        mapping_df = csv.reader(file)
        mapping_dict = {}
        # Import all indices if N_tokens is not given
        for line in mapping_df:
            k, v = line
            mapping_dict[k] = v


    return mapping_dict