From 3ba6a6b44080dd2ce2636dde853faf800f0b7628 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 30 Nov 2021 17:25:38 -0800 Subject: chocula importer: handle not-upper-case ISSNs --- python/fatcat_tools/importers/chocula.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'python/fatcat_tools/importers') diff --git a/python/fatcat_tools/importers/chocula.py b/python/fatcat_tools/importers/chocula.py index a9682a17..8c410d3e 100644 --- a/python/fatcat_tools/importers/chocula.py +++ b/python/fatcat_tools/importers/chocula.py @@ -77,6 +77,10 @@ class ChoculaImporter(EntityImporter): elif "journal " in name.lower(): container_type = "journal" + if row["extra"].get("issnp"): + row["extra"]["issnp"] = row["extra"]["issnp"].upper() + if row["extra"].get("issne"): + row["extra"]["issne"] = row["extra"]["issne"].upper() ce = ContainerEntity( issnl=row["issnl"], issnp=row["extra"].get("issnp"), @@ -149,11 +153,11 @@ class ChoculaImporter(EntityImporter): tmp_issn = existing.extra.pop("issne", None) # clean up bad ISSNs in extra metadata if tmp_issn and len(tmp_issn) == 9: - existing.issne = tmp_issn + existing.issne = tmp_issn.upper() if not existing.issnp: tmp_issn = existing.extra.pop("issnp", None) if tmp_issn and len(tmp_issn) == 9: - existing.issnp = tmp_issn + existing.issnp = tmp_issn.upper() existing.issne = existing.issne or ce.issne existing.issnp = existing.issnp or ce.issnp for k in ("urls", "webarchive_urls"): -- cgit v1.2.3