1. 安装bibtexparser
https://bibtexparser.readthedocs.io/en/main/quickstart.html
pip install --pre bibtexparser
2. 读取bib
文件
import bibtexparser
bibtex_str = "aipsamp.bib"
library = bibtexparser.parse_string(bibtex_str)
print(f"Parsed {len(library.blocks)} blocks, including:"
f"\n\t{len(library.entries)} entries"
f"\n\t{len(library.comments)} comments"
f"\n\t{len(library.strings)} strings and"
f"\n\t{len(library.preambles)} preambles")