dblp導(dǎo)出bibtex格式文獻至mendeley
- dblp導(dǎo)出的bibtex格式的條目的字段中有l(wèi)atex格式內(nèi)容知押,但mendeley識別的不是很好
- 因此可以使用python的解析庫把latex內(nèi)容轉(zhuǎn)為unicode珠叔,然后再導(dǎo)入mendeley,代碼如下
import sys
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.customization import convert_to_unicode
from bibtexparser.bwriter import BibTexWriter
with open(sys.argv[1]) as bibtex_file:
parser = BibTexParser()
parser.customization = convert_to_unicode
bib_database = bibtexparser.load(bibtex_file, parser=parser)
writer = BibTexWriter()
with open('uni-' + sys.argv[1], 'w') as bibfile:
bibfile.write(writer.write(bib_database))