From d3b871be4505c5ce7285c42e8e4374b9bc6e49f8 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Mon, 13 Jan 2020 19:57:13 +0100 Subject: datacite: skip records without a doi --- python/fatcat_tools/importers/datacite.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py index 0de187fb..2f77481a 100644 --- a/python/fatcat_tools/importers/datacite.py +++ b/python/fatcat_tools/importers/datacite.py @@ -269,6 +269,10 @@ class DataciteImporter(EntityImporter): attributes = obj['attributes'] doi = clean_doi(attributes.get('doi', '').lower()) + if not doi: + print('skipping record without a DOI', file=sys.stderr) + return + if not isascii(doi): print('[{}] skipping non-ascii doi for now'.format(doi)) return None -- cgit v1.2.3