diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-10 13:23:12 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-10 13:28:28 -0800 |
commit | 16e9979a6f347b49764c1141209e84083ea81057 (patch) | |
tree | ccc3d35607cadac4933e9b28366bedf5a605c122 /python/fatcat_tools/importers/pubmed.py | |
parent | ab4e1355bf93e3755985f1b5cd2589a78601d253 (diff) | |
download | fatcat-16e9979a6f347b49764c1141209e84083ea81057.tar.gz fatcat-16e9979a6f347b49764c1141209e84083ea81057.zip |
importers: refactor imports of clean() and other normalization helpers
Diffstat (limited to 'python/fatcat_tools/importers/pubmed.py')
-rw-r--r-- | python/fatcat_tools/importers/pubmed.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/python/fatcat_tools/importers/pubmed.py b/python/fatcat_tools/importers/pubmed.py index d32fcefa..3274234f 100644 --- a/python/fatcat_tools/importers/pubmed.py +++ b/python/fatcat_tools/importers/pubmed.py @@ -8,9 +8,16 @@ import fatcat_openapi_client from bs4 import BeautifulSoup from fatcat_openapi_client import ApiClient, ReleaseEntity -from fatcat_tools.normal import clean_doi, clean_issn, clean_pmcid, clean_pmid +from fatcat_tools.normal import ( + LANG_MAP_MARC, + clean_doi, + clean_issn, + clean_pmcid, + clean_pmid, + clean_str, +) -from .common import LANG_MAP_MARC, EntityImporter, clean +from .common import EntityImporter # from: https://www.ncbi.nlm.nih.gov/books/NBK3827/table/pubmedhelp.T.publication_types/?report=objectonly PUBMED_RELEASE_TYPE_MAP = { @@ -704,14 +711,14 @@ class PubmedImporter(EntityImporter): if extra_pubmed: extra["pubmed"] = extra_pubmed - title = clean(title) + title = clean_str(title) if not title: return None re = fatcat_openapi_client.ReleaseEntity( work_id=None, title=title, - original_title=clean(original_title), + original_title=clean_str(original_title), release_type=release_type, release_stage=release_stage, release_date=release_date, |