aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-08-30 19:37:04 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-08-30 19:37:04 -0700
commit1b10d844f20df008fa9848d4ee83e294ed9c6523 (patch)
treebd4d8c5fe691595f5e606aa917887ea16560dacd /python/fatcat
parentd046bee7a76576cf14a2815b787247fca8c44433 (diff)
downloadfatcat-1b10d844f20df008fa9848d4ee83e294ed9c6523.tar.gz
fatcat-1b10d844f20df008fa9848d4ee83e294ed9c6523.zip
importers: create editgroup and pass
Diffstat (limited to 'python/fatcat')
-rw-r--r--python/fatcat/crossref_importer.py2
-rw-r--r--python/fatcat/importer_common.py4
-rw-r--r--python/fatcat/issn_importer.py2
-rw-r--r--python/fatcat/orcid_importer.py2
4 files changed, 6 insertions, 4 deletions
diff --git a/python/fatcat/crossref_importer.py b/python/fatcat/crossref_importer.py
index b12851dc..7540cf61 100644
--- a/python/fatcat/crossref_importer.py
+++ b/python/fatcat/crossref_importer.py
@@ -152,4 +152,4 @@ class FatcatCrossrefImporter(FatcatImporter):
re.container_id = container.ident
self._issnl_id_map[ce.issnl] = container.ident
release_batch.append(re)
- self.api.create_release_batch(release_batch, autoaccept=True)
+ self.api.create_release_batch(release_batch, autoaccept=True, editgroup=editgroup_id)
diff --git a/python/fatcat/importer_common.py b/python/fatcat/importer_common.py
index c1566e65..0b02d175 100644
--- a/python/fatcat/importer_common.py
+++ b/python/fatcat/importer_common.py
@@ -43,7 +43,9 @@ class FatcatImporter:
def process_batch(self, source, size=50):
"""Reads and processes in batches (not API-call-per-)"""
for rows in grouper(source, size):
- self.create_batch(rows)
+ eg = self.api.create_editgroup(
+ fatcat_client.Editgroup(editor_id='aaaaaaaaaaaabkvkaaaaaaaaae'))
+ self.create_batch(rows, editgroup_id=eg.id)
def process_csv_source(self, source, group_size=100, delimiter=','):
reader = csv.DictReader(source, delimiter=delimiter)
diff --git a/python/fatcat/issn_importer.py b/python/fatcat/issn_importer.py
index 6b806b40..2cb954e9 100644
--- a/python/fatcat/issn_importer.py
+++ b/python/fatcat/issn_importer.py
@@ -70,4 +70,4 @@ class FatcatIssnImporter(FatcatImporter):
objects = [o for o in objects if o != None]
for o in objects:
o.editgroup_id = editgroup_id
- self.api.create_container_batch(objects, autoaccept=True)
+ self.api.create_container_batch(objects, autoaccept=True, editgroup=editgroup_id)
diff --git a/python/fatcat/orcid_importer.py b/python/fatcat/orcid_importer.py
index cc12d50d..0b9860eb 100644
--- a/python/fatcat/orcid_importer.py
+++ b/python/fatcat/orcid_importer.py
@@ -71,4 +71,4 @@ class FatcatOrcidImporter(FatcatImporter):
objects = [o for o in objects if o != None]
for o in objects:
o.editgroup_id = editgroup_id
- self.api.create_creator_batch(objects, autoaccept=True)
+ self.api.create_creator_batch(objects, autoaccept=True, editgroup=editgroup_id)