sciunto-org / python-bibtexparser

Bibtex parser for Python 3
https://bibtexparser.readthedocs.io
MIT License
474 stars 132 forks source link

Write to database? #364

Closed boyanpenkov closed 1 year ago

boyanpenkov commented 1 year ago

Hello folks,

Once I successfully have a bibtexparser.bibdatabase instance that's populated, can I add an entry and write the file back to disk?

https://bibtexparser.readthedocs.io/en/master/bibtexparser.html#bibtexparser-bibdatabase-the-bibliographic-database-object seems to have source for re-writing crossrefs, but to add a new entry, should I just treat databse.entries{} as a dict, add to that and write back?

Thanks kindly, and cheers!

boyanpenkov commented 1 year ago

Confirming that @omangin made a comment in https://github.com/sciunto-org/python-bibtexparser/issues/186 that shows the way forward here.