diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-30 17:25:38 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-30 17:25:38 -0800 |
commit | 3ba6a6b44080dd2ce2636dde853faf800f0b7628 (patch) | |
tree | 9c5e6cdeef438ea1299ef8f09ab53418d9cc7b98 /python/fatcat_tools/importers | |
parent | b1efd59c2cad275d126a1bde67c11430d71878db (diff) | |
download | fatcat-3ba6a6b44080dd2ce2636dde853faf800f0b7628.tar.gz fatcat-3ba6a6b44080dd2ce2636dde853faf800f0b7628.zip |
chocula importer: handle not-upper-case ISSNs
Diffstat (limited to 'python/fatcat_tools/importers')
-rw-r--r-- | python/fatcat_tools/importers/chocula.py | 8 |
1 files changed, 6 insertions, 2 deletions
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"): |