Skip to content

Instantly share code, notes, and snippets.

@ntung
Forked from jrsmith3/doi2bib.py
Created February 26, 2016 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntung/78e0e50ea04642cccea5 to your computer and use it in GitHub Desktop.
Save ntung/78e0e50ea04642cccea5 to your computer and use it in GitHub Desktop.
Python method to access crossref.org DOI bibtex metadata resolver
import requests
def doi2bib(doi):
"""
Return a bibTeX string of metadata for a given DOI.
"""
url = "http://dx.doi.org/" + doi
headers = {"accept": "application/x-bibtex"}
r = requests.get(url, headers = headers)
return r.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment