Skip to main content

PubMed Central (PMC) Open Access Articles Downloader

Project description

PMCDownloader

PMCDownloader is a Python library built to streamline the process of searching and downloading open-access articles from PubMed Central (PMC). Whether you need to collect articles for research, manage references, or automate data extraction, this tool simplifies the process, offering a reliable way to retrieve metadata and PDFs of relevant articles.

Purpose

PMCDownloader allows researchers and developers to efficiently:

  • Search for scientific articles in PubMed Central (PMC) using customizable search terms.
  • Download full-text PDFs of the articles directly to your local storage.
  • Retrieve detailed metadata for each article, facilitating better organization and management of references.
  • Automate the downloading process with robust error handling, retries, and rate-limiting.

This tool is especially beneficial for:

  • Automating research tasks like bulk downloading academic papers.
  • Ensuring reproducibility of research by retrieving articles directly from a trusted, open-access repository.
  • Saving time by eliminating manual article search and download steps.

Features

  • Custom Search: Allows you to search PMC for articles based on specific search terms (e.g., disease, topic, author).
  • Metadata Retrieval: Fetch article metadata, including titles, publication details, and more.
  • PDF Downloads: Download the full-text PDFs of articles directly from PMC.
  • Directory Customization: Specify the output directory for storing the downloaded PDFs.
  • Rate Limiting & Robust Error Handling: Handles retries, timeouts, and rate-limiting to ensure stable operation even under high load.
  • Search Filters: Filter search results by article type, publication status, and other criteria to refine your results.
  • Max Results Control: Control the number of search results returned, making it easier to manage large datasets.

Installation

To install the library via pip, run the following command:

pip install pmc_downloader

Example Usage

from pmc_downloader import PMCDownloader

downloader = PMCDownloader(
    email="your@email.com",
    api_key="your_api_key",
    search_terms="machine learning cancer",
    output_dir="./articles",
    max_results=50
)

pmc_ids = downloader.search_articles()
downloader.download_articles(pmc_ids, download_count=10)

Example Search Query

search_query = '''
(
  "student-teacher interaction"[Title/Abstract] OR
  "educational outcomes"[Title/Abstract]
)
AND ("open access"[filter])
NOT ("online learning" OR "AI")
'''

Parameters

Mandatory Parameters:

  • email: Registered email for NCBI API
  • api_key: Your NCBI API key
  • search_terms: PubMed search query
  • output_dir: Directory where downloaded files will be saved

Optional Parameters:

  • max_results (default: 1000): Maximum search results
  • request_delay (default: 1.0): Wait time between API requests (seconds)
  • timeout (default: 15.0): Download process timeout period
  • max_retries (default: 3): Maximum number of retries for failed requests

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

pmc_downloader-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

pmc_downloader-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pmc_downloader-0.1.0.tar.gz.

File metadata

  • Download URL: pmc_downloader-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pmc_downloader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 684044c4bb7d7dd9844e541fa50decec875db7bf4591e7bb1014044994044e5b
MD5 7a427da3df105ebd7d8c15a4b0c2bb75
BLAKE2b-256 a89af5c4b89073ddb3ac5cfcdfbcc1cf6b5683e9d002d0c59979ec3236168534

See more details on using hashes here.

File details

Details for the file pmc_downloader-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pmc_downloader-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pmc_downloader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bdd2b17e0b8135eec88a7b447c38b4e1faeca0c7e8ed1fc256765381edcf4e1
MD5 371119daa8e4645d5f78560fac46f085
BLAKE2b-256 622036a60f45a6f77f32a9c05c1c1b90b5df46290e17049c5a37f6c0c9d79176

See more details on using hashes here.

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