Skip to main content

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

CI codecov

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

searchpubmed-0.3.8.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

searchpubmed-0.3.8-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file searchpubmed-0.3.8.tar.gz.

File metadata

  • Download URL: searchpubmed-0.3.8.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for searchpubmed-0.3.8.tar.gz
Algorithm Hash digest
SHA256 511a70ada6ba31208d9405f0487f1dfa012ee0d57b1a7bb72cbc8983cddec6a4
MD5 35bdd754dbcda4c5ac2daf95b2557f3f
BLAKE2b-256 e7b226dd6697840064d217ef915c501a5fa407a83c58fc0751a4ed84f9ed1c6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for searchpubmed-0.3.8.tar.gz:

Publisher: publish.yml on OHDSI/searchpubmed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file searchpubmed-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: searchpubmed-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for searchpubmed-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3cbcb22ba2b8d9b668a6d227a35ead5be0f38987ae4f856d80684a1f3b1b736e
MD5 b54a64706a41362f409b7e8666a52e0c
BLAKE2b-256 4a79fcadfc633a120a744f4de104c0825a5bb85264fedd396912c12b04af43c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for searchpubmed-0.3.8-py3-none-any.whl:

Publisher: publish.yml on OHDSI/searchpubmed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page