Datasets:
Tasks:
Tabular Classification
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
dietary-supplements
biomarkers
meta-analysis
randomized-controlled-trials
effect-size
laboratory-medicine
License:
Mirror of supplement-lab-effects 1.0.0 (Zenodo doi:10.5281/zenodo.24543303, GitHub caraulani/supplement-lab-effects)
66aa7dc verified Download scripts/search_epmc.py from lifefrom/supplement-lab-effects: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/datasets/lifefrom/supplement-lab-effects/resolve/main/scripts/search_epmc.py
- Command line
-
hf download hf://datasets/lifefrom/supplement-lab-effects/scripts/search_epmc.py
-
curl -L -o search_epmc.py https://huggingface.co/datasets/lifefrom/supplement-lab-effects/resolve/main/scripts/search_epmc.py
1.16 kB
| """Search Europe PMC and print one line per hit (PMCID, DOI, year, OA flag, title). | |
| Usage: python3 -I scripts/search_epmc.py 'QUERY' [pageSize] [sort, default 'CITED desc'; use 'P_PDATE_D desc' for newest] | |
| Example query: '(berberine) AND (HbA1c) AND (meta-analysis) AND OPEN_ACCESS:y' | |
| """ | |
| import json | |
| import sys | |
| import urllib.parse | |
| import urllib.request | |
| q = sys.argv[1] | |
| n = sys.argv[2] if len(sys.argv) > 2 else "25" | |
| sort = sys.argv[3] if len(sys.argv) > 3 else "CITED desc" | |
| url = ( | |
| "https://www.ebi.ac.uk/europepmc/webservices/rest/search?format=json&resultType=lite" | |
| f"&pageSize={n}&sort=" + urllib.parse.quote(sort) + "&query=" + urllib.parse.quote(q) | |
| ) | |
| req = urllib.request.Request(url, headers={"User-Agent": "LifeFrom-open-build/1.0"}) | |
| with urllib.request.urlopen(req, timeout=60) as r: | |
| d = json.load(r) | |
| print("hits:", d.get("hitCount")) | |
| for h in d.get("resultList", {}).get("result", []): | |
| print( | |
| h.get("pmcid", "-"), "|", h.get("doi", "-"), "|", h.get("pubYear"), "|", | |
| "OA" if h.get("isOpenAccess") == "Y" else "noOA", "|", h.get("citedByCount"), "cites |", | |
| h.get("journalTitle"), "|", h.get("title"), | |
| ) | |