How can I get pybtex to read an absent field as NULL instead of skipping the record?
问题 I have been using pybtex (using a modified version of this) to pass records from a .bib file into a .csv like so from pybtex.database.input import bibtex import csv parser = bibtex.Parser() bibdata = parser.parse_file("../../bib/small.bib") # create csv file with open('smallbib.csv', mode ='w') as csv_file: fieldnames = ['DOI', 'number'] writer = csv.DictWriter(csv_file, fieldnames=fieldnames, lineterminator = '\n') writer.writeheader() for bib_id in bibdata.entries: b = bibdata.entries[bib