pr-omethe-us / PyKED

Python interface to the ChemKED database format
https://pr-omethe-us.github.io/PyKED/
BSD 3-Clause "New" or "Revised" License
15 stars 15 forks source link

Allow handling of DataCite (e.g.) DOIs in addition to Crossref #9

Open kyleniemeyer opened 8 years ago

kyleniemeyer commented 8 years ago

Currently the DOI validator (in branch doi-validator, to be merged via PR #4 ) only supports Crossref DOIs. While most journal papers will have these, we also need to support other DOI registration agencies, in particular DataCite, since paper & data repositories such as Figshare and Zenodo provide DataCite DOIs.

Fortunately, there is a Python package for accessing the DataCite API: http://datacite.readthedocs.io/en/latest/.

This should be added to _validate_isvalid_reference() in chemked/validation.py as a fallback option if the Crossref API returns an HTTPError.

bryanwweber commented 8 years ago

Code from @kyleniemeyer to handle this:

dc = habanero.Crossref(base_url='https://api.datacite.org')
res = dc.works(ids = '10.7287/peerj.preprints.2169')

The API shown above is for members only, the API in this post is the public API