CLI Examples¶
Practical command-line examples for common PMCGrab usage scenarios.
Basic Usage¶
Single Article Processing¶
# Basic usage - process one article
uv run python -m pmcgrab PMC7181753
# With email specification (recommended)
uv run uv run python -m pmcgrab --email researcher@university.edu PMC7181753
# Save to custom directory
uv run uv run python -m pmcgrab --output-dir ./papers --email researcher@university.edu PMC7181753
Multiple Articles¶
# Process several articles at once
uv run uv run python -m pmcgrab PMC7181753 PMC3539614 PMC5454911
# With parallel processing
uv run uv run python -m pmcgrab --workers 4 PMC7181753 PMC3539614 PMC5454911
File Input¶
From Text File¶
Create pmcids.txt
:
Process the list:
Advanced Options¶
Batch Processing with Configuration¶
# Process with custom settings
uv run python -m pmcgrab \
--input-file pmcids.txt \
--output-dir ./output \
--email researcher@university.edu \
--workers 4 \
--batch-size 10 \
--max-retries 2 \
--verbose
Common Parameters¶
Parameter | Description | Example |
---|---|---|
--email |
Your email for NCBI requests | --email user@example.com |
--output-dir |
Output directory for JSON files | --output-dir ./papers |
--workers |
Number of parallel workers | --workers 4 |
--batch-size |
Articles per batch | --batch-size 10 |
--max-retries |
Retry failed requests | --max-retries 2 |
--verbose |
Detailed output | --verbose |
--input-file |
Read PMC IDs from file | --input-file list.txt |
Output¶
PMCGrab saves each article as a JSON file:
Each JSON file contains structured article data including title, abstract, body sections, authors, and metadata.