From 2e813da921513a4b4279a8cae2965138fbbacba3 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 21 Nov 2018 11:59:10 -0800 Subject: crossref importer doesn't require author/title attributes --- python/fatcat_tools/importers/crossref.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'python') 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, -- cgit v1.2.3