diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-22 14:03:02 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-22 14:03:02 -0700 |
commit | dc53c673dd28a325e47659835015e31e8d345692 (patch) | |
tree | 46f356ac79a1081705520a9b828cd24e7dae7723 /python/fatcat_tools/importers | |
parent | 5e48498083cf5b7bccec03ba6352c6acbe6cdb00 (diff) | |
download | fatcat-dc53c673dd28a325e47659835015e31e8d345692.tar.gz fatcat-dc53c673dd28a325e47659835015e31e8d345692.zip |
all new importers need to set contrib index (order)
Diffstat (limited to 'python/fatcat_tools/importers')
-rw-r--r-- | python/fatcat_tools/importers/arxiv.py | 2 | ||||
-rw-r--r-- | python/fatcat_tools/importers/jalc.py | 6 | ||||
-rw-r--r-- | python/fatcat_tools/importers/jstor.py | 4 | ||||
-rw-r--r-- | python/fatcat_tools/importers/pubmed.py | 4 |
4 files changed, 14 insertions, 2 deletions
diff --git a/python/fatcat_tools/importers/arxiv.py b/python/fatcat_tools/importers/arxiv.py index e6fb8039..38d10da3 100644 --- a/python/fatcat_tools/importers/arxiv.py +++ b/python/fatcat_tools/importers/arxiv.py @@ -117,7 +117,7 @@ class ArxivRawImporter(EntityImporter): doi = None title = latex_to_text(metadata.title.string) authors = parse_arxiv_authors(metadata.authors.string) - contribs = [fatcat_client.ReleaseContrib(raw_name=a, role='author') for a in authors] + contribs = [fatcat_client.ReleaseContrib(index=i, raw_name=a, role='author') for i, a in enumerate(authors)] lang = "en" # the vast majority in english if metadata.comments and metadata.comments.string: diff --git a/python/fatcat_tools/importers/jalc.py b/python/fatcat_tools/importers/jalc.py index d560686f..94ebeff9 100644 --- a/python/fatcat_tools/importers/jalc.py +++ b/python/fatcat_tools/importers/jalc.py @@ -157,7 +157,7 @@ class JalcImporter(EntityImporter): given_name = eng.find('givenName') if given_name: given_name = given_name.string - contrib = dict( + contrib = fatcat_client.ReleaseContrib( raw_name=clean(eng.find('name').string), given_name=clean(given_name), surname=clean(surname), @@ -165,6 +165,10 @@ class JalcImporter(EntityImporter): ) contribs.append(contrib) + for i, contrib in enumerate(contribs): + if contrib.raw_name != "et al.": + contrib.index = i + release_year = None release_date = None date = record.date or None diff --git a/python/fatcat_tools/importers/jstor.py b/python/fatcat_tools/importers/jstor.py index 6e6ec6a0..5016e813 100644 --- a/python/fatcat_tools/importers/jstor.py +++ b/python/fatcat_tools/importers/jstor.py @@ -165,6 +165,10 @@ class JstorImporter(EntityImporter): surname=surname, )) + for i, contrib in enumerate(contribs): + if contrib.raw_name != "et al.": + contrib.index = i + release_year = None release_date = None pub_date = article_meta.find('pub-date') diff --git a/python/fatcat_tools/importers/pubmed.py b/python/fatcat_tools/importers/pubmed.py index b79eb1f8..eecf99f6 100644 --- a/python/fatcat_tools/importers/pubmed.py +++ b/python/fatcat_tools/importers/pubmed.py @@ -615,6 +615,10 @@ class PubmedImporter(EntityImporter): if medline.AuthorList['CompleteYN'] == 'N': contribs.append(fatcat_client.ReleaseContrib(raw_name="et al.")) + + for i, contrib in enumerate(contribs): + if contrib.raw_name != "et al.": + contrib.index = i if not contribs: contribs = None |