summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools
diff options
context:
space:
mode:
authorMartin Czygan <martin@archive.org>2020-01-13 19:00:01 +0000
committerMartin Czygan <martin@archive.org>2020-01-13 19:00:01 +0000
commit5235b034058f9c0cf8a418a4854ba1491fa347c7 (patch)
treebd31bc4abff6f5c6adb37508a8091c5b0a0988d8 /python/fatcat_tools
parent9cdf476863dd686fa928dfb8a99825a9fd6776fe (diff)
parentd3b871be4505c5ce7285c42e8e4374b9bc6e49f8 (diff)
downloadfatcat-5235b034058f9c0cf8a418a4854ba1491fa347c7.tar.gz
fatcat-5235b034058f9c0cf8a418a4854ba1491fa347c7.zip
Merge branch 'martin-datacite-fix-isascii' into 'master'
datacite: skip records without a doi See merge request webgroup/fatcat!16
Diffstat (limited to 'python/fatcat_tools')
-rw-r--r--python/fatcat_tools/importers/datacite.py4
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