def parse_bibfile_to_dict(bib_path):
    """Read a bibtex file into a dictionary.
    Returned dictionary has the form:

    {'alberga2018prediction': ['title={Prediction of ... }'],
     'hawkins2007comparison': ['title={Comparison of ... }'],\
     ...

    }

    """
    dct = {}
    with open(bib_path, 'r') as f:
        txt = f.readlines()
        citekey = None
        entries = []
        for line in txt:
            line = line.strip()
            if line:
                if line.startswith('@'):
                    if citekey is not None:
                        dct[citekey] = entries
                    entries = []
                    start = line.find('{')
                    end = line.find(',')
                    citekey = '%s' % line[start+1:end].lower()
                entries.append(line)
    if citekey is not None:
        dct[citekey] = entries

    return dct