pubs/pubs/apis.py
2015-01-08 14:58:41 +01:00

13 lines
288 B
Python

"""Interface for Remote Bibliographic APIs"""
import requests
def doi2bibtex(doi):
"""Return a bibtex string of metadata from a DOI"""
url = 'http://dx.doi.org/{}'.format(doi)
headers = {'accept': 'application/x-bibtex'}
r = requests.get(url, headers=headers)
return r.text