It's not a module per se, and isn't specific for DOIs but you could do something like the following:
def getDOI(top_hit):
"""Query the PDB REST API to get an associated DOI/Publication"""import requests
try:
query = requests.get("https://www.ebi.ac.uk/pdbe/api/pdb/entry/publications/" + str(top_hit))
qjson = query.json()
doi = qjson[top_hit][0]['doi']if not doi:
doi ="No DOI found."
except KeyError:
doi ="Key error. ID likely deprecated."return doi
I use this code snippet to return DOIs from a PDB ID query. You may be able to chop it up to suit your own needs.
You could try Europe PMC API to retrieve publication full text via DOI. You would need to first map the DOI to the corresponding PMCID using the search module, and then use the PMCID to retrieve full text XML from the open access subset.
Here is an example: search module for the following DOI (10.1371/journal.ppat.1002485) returns PMC3257301 as a PMCID, then fullTextXML module for PMC3257301 retrieves the full text.