summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-01-08 23:19:48 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-01-08 23:19:48 +0100
commit277bd183d7139bb1a8857bc2a48c0aa92012455d (patch)
treec1f9a859112b93daefccb1dd1ea3b03fcd844bd7 /python
parentd3deb36c26ae86c1763c33a8c356ecd5491caa40 (diff)
downloadfatcat-277bd183d7139bb1a8857bc2a48c0aa92012455d.tar.gz
fatcat-277bd183d7139bb1a8857bc2a48c0aa92012455d.zip
datacite: pass in doi into factored out method
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/datacite.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index 9ca72758..b1862b44 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -307,7 +307,7 @@ class DataciteImporter(EntityImporter):
creators = attributes.get('creators', []) or []
contributors = attributes.get('contributors', []) or [] # Much fewer than creators.
- contribs = self.parse_datacite_creators(creators) + self.parse_datacite_creators(contributors, role=None, set_index=False)
+ contribs = self.parse_datacite_creators(creators, doi=doi) + self.parse_datacite_creators(contributors, role=None, set_index=False, doi=doi)
# Title, may come with "attributes.titles[].titleType", like
# "AlternativeTitle", "Other", "Subtitle", "TranslatedTitle"
@@ -690,10 +690,11 @@ class DataciteImporter(EntityImporter):
extra=self.editgroup_extra),
entity_list=batch))
- def parse_datacite_creators(self, creators, role='author', set_index=True):
+ def parse_datacite_creators(self, creators, role='author', set_index=True, doi=None):
"""
Parses a list of creators into a list of ReleaseContrib objects. Set
set_index to False, if the index contrib field should be left blank.
+ The doi parameter is only used for debugging.
"""
# Contributors. Many nameIdentifierSchemes, we do not use (yet):
# "attributes.creators[].nameIdentifiers[].nameIdentifierScheme":