bib_data = parser.parse_file('ref.bib')

def sort_by_year(y, x):
    return int(x[1].fields['year']) - int(y[1].fields['year'])
bib_sorted = sorted(list(bib_data.entries.items()), cmp=sort_by_year)
for key, value in bib_sorted:
    print(key)
print(value.fields['year'])
print(value.fields['author'])
print(value.fields['title'])
converting bibtex files to html with python (maybe pybtex?)