Skip to content

Repository files navigation

Pharma Intelligence Pipeline

A lightweight daily digest of pharma news, RCTs, and guideline updates — no database needed.

Setup (5 minutes)

1. Install dependencies

pip install requests

That's the only external library needed.

2. Configure config.py

Fill in:

  • ANTHROPIC_API_KEY — from https://console.anthropic.com
  • PUBMED_EMAIL — your email (required by NCBI)
  • NEWS_API_KEY — free from https://newsapi.org (optional but recommended)
  • EMAIL_SENDER / EMAIL_PASSWORD — Gmail + App Password for delivery
    • In Gmail: Settings → Security → 2-Step Verification → App Passwords

3. Add your guidelines

Create a guidelines/ folder and add .txt files with key excerpts:

guidelines/
  nccn_nsclc.txt        ← paste NCCN NSCLC treatment algorithm text
  nccn_breast.txt       ← paste NCCN breast cancer key recommendations
  ada_standards.txt     ← paste ADA Standards of Care key tables

Tip: You don't need the full PDF. Extract just the treatment algorithm tables and key recommendation boxes — 500–1500 words per guideline is enough for Claude to work with.

4. Run it

python run_pipeline.py

5. Schedule with cron (Mac/Linux)

Run every morning at 6:30am:

crontab -e

Add this line:

30 6 * * 1-5 cd /path/to/pharma_pipeline && python run_pipeline.py >> logs/pipeline.log 2>&1

On Windows, use Task Scheduler pointing to run_pipeline.py.


File structure

pharma_pipeline/
├── config.py           ← your settings (don't commit this to git)
├── run_pipeline.py     ← entry point
├── fetch_all.py        ← PubMed, NewsAPI, ClinicalTrials, openFDA
├── build_prompt.py     ← assembles data + guidelines into Claude prompt
├── claude_api.py       ← calls Claude and returns report
├── send_report.py      ← email or Slack delivery
├── guidelines/         ← your .txt guideline excerpts (create this folder)
└── reports/            ← auto-created, stores daily report archive

Estimated monthly cost

Component Cost
Claude API (~8K tokens/day) ~$1.50/month
PubMed API Free
ClinicalTrials.gov API Free
openFDA API Free
NewsAPI (free tier) Free (100 req/day)
Gmail SMTP Free
Total ~$1.50/month

Customizing therapeutic areas

Edit THERAPEUTIC_AREAS in config.py:

  • Add new TAs with their own PubMed MeSH terms
  • Point to different guideline files
  • Adjust news_keywords to tune the news filter

Adding real-world data later

If you gain access to SEER or a claims dataset, add a fetch_rwd() function to fetch_all.py following the same pattern, and add a format_rwd() block to build_prompt.py.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages