High-level helpers for PubMed search, metadata & full-text retrieval.
Project description
searchpubmed
A Python helper‑library for programmatic PubMed work:
- Search – build and run complex boolean queries (E‑Search)
- Link – map PMIDs ↔ PMCIDs (E‑Link)
- Fetch – pull rich article metadata (E‑Fetch / E‑Summary)
- Full‑text – download JATS XML + HTML from PMC
- Analyse – get tidy results as pandas DataFrames
Query‑builder
The package now ships with a lightweight query‑builder and five pre‑tuned strategies for common real‑world‑data searches.
from searchpubmed import build_query, STRATEGY3_OPTS
print(build_query(STRATEGY3_OPTS)[:120] + "…")
# => (("observational" 5 "ehr"[tiab] OR …) AND english[lang] AND ("2010"[dp] : "3000"[dp]))
Create your own QueryOptions:
from searchpubmed import QueryOptions, build_query
opts = QueryOptions(
data_sources=["ehr", "claims"], # synonym keys
design_terms=["observational", "secondary"],
proximity_within=None,
)
print(build_query(opts))
Core features
- Perform complex boolean searches (AND/OR/NOT, phrase, proximity N)
- Batch retrieval of PMIDs and conversion to PMCIDs
- Fetch detailed metadata (title, abstract, authors, journal, date)
- Configurable rate‑limiting to stay within NCBI usage caps
- Results returned as pandas DataFrames for instant analysis
Installation
pip install searchpubmed
License
Apache 2.0 – see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file searchpubmed-0.4.4.tar.gz.
File metadata
- Download URL: searchpubmed-0.4.4.tar.gz
- Upload date:
- Size: 31.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c3766794ea38774cbd956b63f53b848a3c4d5bf854a6f333c501e229065fec6
|
|
| MD5 |
a6e0dfe8ddcbeb6986909802443364d8
|
|
| BLAKE2b-256 |
d6ce218d26f34f64668c2900cdb8556e7e1fcd77ae5861581b5f1a5b499df34b
|
Provenance
The following attestation bundles were made for searchpubmed-0.4.4.tar.gz:
Publisher:
publish.yml on OHDSI/searchpubmed
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
searchpubmed-0.4.4.tar.gz -
Subject digest:
9c3766794ea38774cbd956b63f53b848a3c4d5bf854a6f333c501e229065fec6 - Sigstore transparency entry: 205129588
- Sigstore integration time:
-
Permalink:
OHDSI/searchpubmed@faf3c71164e031a0671e9efdbc13c34e6e9abfb0 -
Branch / Tag:
refs/tags/v0.4.4 - Owner: https://github.com/OHDSI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@faf3c71164e031a0671e9efdbc13c34e6e9abfb0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file searchpubmed-0.4.4-py3-none-any.whl.
File metadata
- Download URL: searchpubmed-0.4.4-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2aea0693d9e26f8c7ee77600376c9be7d0459eef7b0e676847ce2f5c9ed46ad
|
|
| MD5 |
b63a6da530d8f52537624c712d30740f
|
|
| BLAKE2b-256 |
8267014335246fe4e835cfca5fbc231b0dedcd4e377a75b5cd1eb722fd66fd62
|
Provenance
The following attestation bundles were made for searchpubmed-0.4.4-py3-none-any.whl:
Publisher:
publish.yml on OHDSI/searchpubmed
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
searchpubmed-0.4.4-py3-none-any.whl -
Subject digest:
f2aea0693d9e26f8c7ee77600376c9be7d0459eef7b0e676847ce2f5c9ed46ad - Sigstore transparency entry: 205129589
- Sigstore integration time:
-
Permalink:
OHDSI/searchpubmed@faf3c71164e031a0671e9efdbc13c34e6e9abfb0 -
Branch / Tag:
refs/tags/v0.4.4 - Owner: https://github.com/OHDSI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@faf3c71164e031a0671e9efdbc13c34e6e9abfb0 -
Trigger Event:
push
-
Statement type: