MicheleCotrufo / pdf2bib

A python library/command-line tool to quickly and automatically generate BibTeX data starting from the pdf file of a scientific publication.
58 stars 7 forks source link

Option to get bibtex info by doi #2

Closed Johny-Leo closed 2 years ago

Johny-Leo commented 2 years ago

Hi, Michele,

What do you suggest if I need to search for the bibtex info by the doi ? Your previous function of doi2bib is now not available in this package. The reason for this need is that sometimes the pdf2doi cannot find a correct doi but I made an excel sheet for all the doi where that missing doi is added manually.

Thanks!

MicheleCotrufo commented 2 years ago

I think the best option would be to first use the function validate_doi_web, defined in the finders.py module of pdf2doi. You can pass the doi to this function, and it should return bibtex data but in a raw format. This might already be good for your purposes. If not, you can feed the output of validate_doi_web to the the function parse_bib_from_dxdoiorg defined in pdf2bib in this module https://github.com/MicheleCotrufo/pdf2bib/blob/master/pdf2bib/bibtex_makers.py, which will return a dictionary.

You can also give a look to this other package, https://github.com/bibcure/doi2bib

Johny-Leo commented 2 years ago

I think the best option would be to first use the function validate_doi_web, defined in the finders.py module of pdf2doi. You can pass the doi to this function, and it should return bibtex data but in a raw format. This might already be good for your purposes. If not, you can feed the output of validate_doi_web to the the function parse_bib_from_dxdoiorg defined in pdf2bib in this module https://github.com/MicheleCotrufo/pdf2bib/blob/master/pdf2bib/bibtex_makers.py, which will return a dictionary.

You can also give a look to this other package, https://github.com/bibcure/doi2bib

Thank you, this certainly works !