diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2020-01-13 19:57:13 +0100 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2020-01-13 19:57:13 +0100 |
commit | d3b871be4505c5ce7285c42e8e4374b9bc6e49f8 (patch) | |
tree | bd31bc4abff6f5c6adb37508a8091c5b0a0988d8 /python/fatcat_tools | |
parent | 9cdf476863dd686fa928dfb8a99825a9fd6776fe (diff) | |
download | fatcat-d3b871be4505c5ce7285c42e8e4374b9bc6e49f8.tar.gz fatcat-d3b871be4505c5ce7285c42e8e4374b9bc6e49f8.zip |
datacite: skip records without a doi
Diffstat (limited to 'python/fatcat_tools')
-rw-r--r-- | python/fatcat_tools/importers/datacite.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 |