Last active
December 20, 2019 11:50
-
-
Save TomDemeranville/2db940a1187c9a7a403f476d660c2a86 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import json | |
url = 'https://doi.org/10.1038/s41586-019-1863-2' | |
headers = {'Accept': 'application/citeproc+json'} | |
req = urllib.request.Request(url, {}, headers) | |
with urllib.request.urlopen(req) as response: | |
doi_metadata = response.read() | |
doi_json = json.loads(doi_metadata) | |
print(doi_json["ISSN"]) |
Note that not all DOIs have an ISSN, as not everything is published in a journal!
To get ISSNs for an ORCID account
- Read their list of works
- For each work that does not have an ISSN, but does have a DOI use the DOI API to discover the ISSN. This will work for Crossref, Datacite, Medra, KISTI DOIs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example use and output:
Toms-MacBook-Pro-4:Desktop tom$ python3 DOItoISSN.py
['0028-0836', '1476-4687']