biblib
biblib copied to clipboard
About PyPI package?
Hi,
So there is a biblib package on PyPI which is unfortunately not the correct one, I was wondering though if there was any plan for releasing this one though. It would be super convenient for automation.
Cheers,
Thomas
You can install like so:
pip install -e git+https://github.com/aclements/biblib.git#egg=biblib
Also works as a separate line in your requirements.txt file:
-e git+https://github.com/aclements/biblib.git#egg=biblib
Working example after installing as above:
from biblib.bib import Parser as BibParser
import requests
def resolve_doi(doi):
bibtext = requests.get(f'https://doi.org/{doi}', headers={
'Accept': 'application/x-bibtex; charset=utf-8'
}).text
parser = BibParser()
parser.parse(bibtext)
entries = parser.get_entries()
return dict(next(iter(entries.values())))