summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-11-21 11:59:10 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-11-21 11:59:10 -0800
commit2e813da921513a4b4279a8cae2965138fbbacba3 (patch)
treef1b8551244d94568dfdef4bff2fe2fcdf117ae30 /python
parent7ec413416acb2b3d7da0be32b78982316b9c696f (diff)
downloadfatcat-2e813da921513a4b4279a8cae2965138fbbacba3.tar.gz
fatcat-2e813da921513a4b4279a8cae2965138fbbacba3.zip
crossref importer doesn't require author/title attributes
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/crossref.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py
index 385a8235..a75b1d5e 100644
--- a/python/fatcat_tools/importers/crossref.py
+++ b/python/fatcat_tools/importers/crossref.py
@@ -75,11 +75,11 @@ class CrossrefImporter(FatcatImporter):
returns a ReleaseEntity
"""
- # This work is out of scope if it doesn't have authors and a title
- if (not 'author' in obj) or (not 'title' in obj):
- return None
+ # Previously required the 'author' and 'title' keys to exsit, but now don't
+ #if (not 'author' in obj) or (not 'title' in obj):
+ # return None
- # Other ways to be out of scope (provisionally)
+ # Ways to be out of scope (provisionally)
# journal-issue and journal-volume map to None, but allowed for now
if obj.get('type') in (None, 'journal', 'proceedings',
'standard-series', 'report-series', 'book-series', 'book-set',
@@ -135,7 +135,7 @@ class CrossrefImporter(FatcatImporter):
role=ctype,
extra=extra))
return contribs
- contribs = do_contribs(obj['author'], "author")
+ contribs = do_contribs(obj.get('author', []), "author")
contribs.extend(do_contribs(obj.get('editor', []), "editor"))
contribs.extend(do_contribs(obj.get('translator', []), "translator"))
@@ -263,7 +263,7 @@ class CrossrefImporter(FatcatImporter):
re = fatcat_client.ReleaseEntity(
work_id=None,
- title=obj['title'][0],
+ title=obj.get('title', [None])[0],
contribs=contribs,
refs=refs,
container_id=container_id,