def load_dict(file_path, values_dtype=str, encoding='ascii'):
    """Load dictionary from textfile.

    Each file's line should be <key: value>

    Parameters
    ----------
    file_path : str
        Full path to the file to read.
    values_dtype : dtype
        Datatype of the values. Default str (string).
    encoding : str, optional
        Encoding to use for reading the file. Default 'ascii'.

    Returns
    -------
    dictionary : dict
        Loaded dictionary with one key for each
        line in the input text file.

    """
    new_dict = {}
    with open(file_path, mode='rt', encoding=encoding) as df:
        for key_line in df:
            # a line is 'key: value'
            key_line_split = key_line.split(':')
            try:
                # Removing any space from key value before setting
                new_dict[key_line_split[0]] = values_dtype(key_line_split[1].strip())
            except IndexError:
                raise ValueError("line '{:}' is not valid.".format(key_line))
    return new_dict