diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-10-12 20:05:57 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-10-13 16:21:31 -0700 |
commit | 3052b094f2b3c1183abc17c9ca158eb6a8808a42 (patch) | |
tree | 815923722b54333d8aa7192c5923d0d90f334374 /python/fatcat_tools/importers/pubmed.py | |
parent | 85f4124d0c70b9fb55e6f549cfd906fcf8783c6f (diff) | |
download | fatcat-3052b094f2b3c1183abc17c9ca158eb6a8808a42.tar.gz fatcat-3052b094f2b3c1183abc17c9ca158eb6a8808a42.zip |
python: partial importer utilization of new schema changes
Diffstat (limited to 'python/fatcat_tools/importers/pubmed.py')
-rw-r--r-- | python/fatcat_tools/importers/pubmed.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/python/fatcat_tools/importers/pubmed.py b/python/fatcat_tools/importers/pubmed.py index 0ff55c05..c34fd7d6 100644 --- a/python/fatcat_tools/importers/pubmed.py +++ b/python/fatcat_tools/importers/pubmed.py @@ -448,9 +448,14 @@ class PubmedImporter(EntityImporter): journal = medline.Article.Journal issnp = journal.find("ISSN", IssnType="Print") if issnp: - container_extra['issnp'] = issnp.string - if not issnl: + issnp = clean_issn(issnp.string) + else: + issnp = None + + if not issnl and issnp: issnl = self.issn2issnl(issnp) + else: + issnl = None if issnl: container_id = self.lookup_issnl(issnl) @@ -490,12 +495,13 @@ class PubmedImporter(EntityImporter): if (container_id is None and self.create_containers and (issnl is not None) and container_name): # name, type, publisher, issnl - # extra: issnp, issne, original_name, languages, country + # extra: original_name, languages, country ce = fatcat_openapi_client.ContainerEntity( name=container_name, container_type='journal', #NOTE: publisher not included issnl=issnl, + issnp=issnp, extra=(container_extra or None)) ce_edit = self.create_container(ce) container_id = ce_edit.ident |