aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-17 13:48:59 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-17 13:48:59 -0800
commit8a36af1664f0399f29a57b639dc0c89033578878 (patch)
treecb35bd1fdf329431820db688dd94b62c842d9ac5 /python/fatcat_tools
parent3c56a6c8da155f4675e48a6f5fa55b1cf9fb096a (diff)
downloadfatcat-8a36af1664f0399f29a57b639dc0c89033578878.tar.gz
fatcat-8a36af1664f0399f29a57b639dc0c89033578878.zip
issn => journal_metadata in several places
Diffstat (limited to 'python/fatcat_tools')
-rw-r--r--python/fatcat_tools/importers/__init__.py2
-rw-r--r--python/fatcat_tools/importers/journal_metadata.py (renamed from python/fatcat_tools/importers/issn.py)10
2 files changed, 6 insertions, 6 deletions
diff --git a/python/fatcat_tools/importers/__init__.py b/python/fatcat_tools/importers/__init__.py
index e6f081e5..47fc1fd3 100644
--- a/python/fatcat_tools/importers/__init__.py
+++ b/python/fatcat_tools/importers/__init__.py
@@ -2,6 +2,6 @@
from .common import FatcatImporter, make_kafka_consumer
from .crossref import CrossrefImporter, CROSSREF_TYPE_MAP
from .grobid_metadata import GrobidMetadataImporter
-from .issn import IssnImporter
+from .journal_metadata import JournalMetadataImporter
from .matched import MatchedImporter
from .orcid import OrcidImporter
diff --git a/python/fatcat_tools/importers/issn.py b/python/fatcat_tools/importers/journal_metadata.py
index f4d525a4..859662ae 100644
--- a/python/fatcat_tools/importers/issn.py
+++ b/python/fatcat_tools/importers/journal_metadata.py
@@ -25,7 +25,7 @@ def truthy(s):
else:
return None
-class IssnImporter(FatcatImporter):
+class JournalMetadataImporter(FatcatImporter):
"""
Imports journal metadata ("containers") by ISSN, currently from a custom
(data munged) .csv file format
@@ -40,12 +40,12 @@ class IssnImporter(FatcatImporter):
eg_desc = kwargs.get('editgroup_description',
"Automated import of container-level metadata, by ISSN. Metadata from Internet Archive munging.")
eg_extra = kwargs.get('editgroup_extra', dict())
- eg_extra['agent'] = eg_extra.get('agent', 'fatcat_tools.IssnImporter')
+ eg_extra['agent'] = eg_extra.get('agent', 'fatcat_tools.JournalMetadataImporter')
super().__init__(api,
editgroup_description=eg_desc,
editgroup_extra=eg_extra)
- def parse_issn_row(self, row):
+ def parse_journal_metadata_row(self, row):
"""
row is a python dict (parsed from CSV).
returns a ContainerEntity (or None if invalid or couldn't parse)
@@ -75,14 +75,14 @@ class IssnImporter(FatcatImporter):
return ce
def create_row(self, row, editgroup_id=None):
- ce = self.parse_issn_row(row)
+ ce = self.parse_journal_metadata_row(row)
if ce is not None:
self.api.create_container(ce, editgroup_id=editgroup_id)
self.counts['insert'] += 1
def create_batch(self, batch):
"""Reads and processes in batches (not API-call-per-line)"""
- objects = [self.parse_issn_row(l)
+ objects = [self.parse_journal_metadata_row(l)
for l in batch if (l is not None)]
objects = [o for o in objects if (o is not None)]
self.api.create_container_batch(objects, autoaccept="true")