Mendeley拾遗

dblp导出bibtex格式文献至mendeley

  • dblp导出的bibtex格式的条目的字段中有latex格式内容,但mendeley识别的不是很好
  • 因此可以使用python的解析库把latex内容转为unicode,然后再导入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))

你可能感兴趣的:(Mendeley拾遗)