aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-02-04 17:20:09 -0800
committerBryan Newbold <bnewbold@robocracy.org>2020-02-04 17:20:12 -0800
commit6ba8bf1b163e70d654968e7157fade23f8f81650 (patch)
tree82e5dd6eb13c4b4a6f20267486e80d999b62b78c /python
parent7724b8e7dd39c2acc5ed404afc32720396dea888 (diff)
downloadfatcat-6ba8bf1b163e70d654968e7157fade23f8f81650.tar.gz
fatcat-6ba8bf1b163e70d654968e7157fade23f8f81650.zip
default to PMC ingest URLs over DOI
For cases where there might be both PMC and DOI urls, do the europmc.org PMC ones over DOI option. May want to turn this into a config or command-line option in the future.
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/transforms/ingest.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/fatcat_tools/transforms/ingest.py b/python/fatcat_tools/transforms/ingest.py
index 27a4fb93..22b5154e 100644
--- a/python/fatcat_tools/transforms/ingest.py
+++ b/python/fatcat_tools/transforms/ingest.py
@@ -23,16 +23,16 @@ def release_ingest_request(release, ingest_request_source='fatcat', ingest_type=
url = "https://arxiv.org/pdf/{}.pdf".format(release.ext_ids.arxiv)
link_source = "arxiv"
link_source_id = release.ext_ids.arxiv
- elif release.ext_ids.doi:
- url = "https://doi.org/{}".format(release.ext_ids.doi)
- link_source = "doi"
- link_source_id = release.ext_ids.doi
elif release.ext_ids.pmcid:
# TODO: how to tell if an author manuscript in PMC vs. published?
#url = "https://www.ncbi.nlm.nih.gov/pmc/articles/{}/pdf/".format(release.ext_ids.pmcid)
url = "http://europepmc.org/backend/ptpmcrender.fcgi?accid={}&blobtype=pdf".format(release.ext_ids.pmcid)
link_source = "pmc"
link_source_id = release.ext_ids.pmcid
+ elif release.ext_ids.doi:
+ url = "https://doi.org/{}".format(release.ext_ids.doi)
+ link_source = "doi"
+ link_source_id = release.ext_ids.doi
if not url:
return None