diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/sandcrawler/db.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/python/sandcrawler/db.py b/python/sandcrawler/db.py index c87b0ae..e60b310 100644 --- a/python/sandcrawler/db.py +++ b/python/sandcrawler/db.py @@ -77,6 +77,15 @@ class SandcrawlerPostgrestClient: else: return None + def get_crossref(self, doi): + resp = requests.get(self.api_url + "/crossref", params=dict(doi='eq.'+doi)) + resp.raise_for_status() + resp = resp.json() + if resp: + return resp[0] + else: + return None + class SandcrawlerPostgresClient: def __init__(self, db_url, **kwargs): |