A CLI tool to fetch research papers from PubMed with author affiliation filtering
Project description
PubMed Pharma Paper Finder
A Python tool to fetch research papers from PubMed and filter for those with authors affiliated with pharmaceutical or biotech companies. Perfect for researchers and analysts tracking industry research contributions.
Features
- 🔍 Search PubMed using standard query syntax
- 🤖 AI-powered query suggestions
- 🏢 Company affiliation detection
- 📊 Export results to CSV
- 🌐 Web interface and CLI support
Quick Start
# Install from Test PyPI
pip install -i https://test.pypi.org/simple/ fetch-papers-nishi==0.1.0
# Run via CLI
get-papers-list "your search query" -f output.csv
# Or use in Python code
from fetch_papers import PubMedFetcher
fetcher = PubMedFetcher()
results = fetcher.search("cancer therapy")
Web Interface
Access the web interface by running:
python main.py
Then open your browser to http://localhost:5000
CLI Usage Examples
# Basic search
get-papers-list "cancer therapy"
# Specify max results
get-papers-list "diabetes" --max-results 50
# Save to CSV
get-papers-list "clinical trial" -f results.csv
Advanced Search Tips
Use PubMed's powerful search syntax:
- Date range:
"2020/01/01"[Date - Publication] : "2020/12/31"[Date - Publication] - Author search:
Smith J[Author] - Publication type:
clinical trial[Publication Type] - Combined search:
diabetes AND (insulin OR metformin) NOT "type 1"
Development
- Clone the repository
- Install dependencies:
poetry install - Run tests:
poetry run pytest - Start web server:
python main.py
Contributing
See CONTRIBUTING.md for guidelines on:
- Code style
- Pull request process
- Development setup
Tools and Libraries Used
This project is built using the following tools and libraries:
- Python (3.9+): Core programming language
- Poetry: Dependency management and packaging
- Biopython (1.81+): Scientific tools for biological computation, used for PubMed API interaction via the Entrez module
- Flask (3.1+): Web framework for the user interface
- Pandas (2.0+): Data manipulation and analysis library, used for CSV processing
- Click (8.1+): Command-line interface creation toolkit
- scikit-learn (1.3+): Machine learning library used for AI-powered query suggestions
- Gunicorn (23.0+): WSGI HTTP server for deploying the web application
- Bootstrap (5.3+): Frontend CSS framework for responsive design
- jQuery (3.7+): JavaScript library for interactive features
- pytest (7.0+): Testing framework
- tqdm (4.65+): Progress bar library
- PyInstaller (6.0+): Tool to bundle the application into a standalone executable
PubMed API Usage
This tool uses the NCBI Entrez API through Biopython to fetch data from PubMed. It adheres to NCBI's usage guidelines, including:
- No more than 3 requests per second
- Including an email address in API requests
- Properly citing NCBI as the data source
Publishing to TestPyPI
The module is published on TestPyPI. You can find it here: fetch-papers-nishi
To install the package from TestPyPI:
pip install -i https://test.pypi.org/simple/ fetch-papers-nishi
To publish a new version:
- Update version in pyproject.toml
- Build the package:
poetry build - Publish to TestPyPI:
poetry publish -r testpypi
Current version: 0.1.2
Contact & Links
Developed by Nishi Chaudhary
- Email: nishichaudhary2001@gmail.com
- LinkedIn: Nishi Chaudhary
- GitHub: nchaudhary12
- HackerRank: nishichaudhary21
- TestPyPI: fetch-papers-nishi
Repository Protection
This repository is protected. While users can clone and use the code, they cannot modify or delete the repository contents. All changes must be approved by the repository owner.
License
MIT License - see LICENSE
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 fetch_papers_nishi-0.1.4.tar.gz.
File metadata
- Download URL: fetch_papers_nishi-0.1.4.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.11.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1f025c885e5e6130dad9c422c70354298e7d4ae82302b4208b550bd8e8b26d6
|
|
| MD5 |
7620045b8bbf9b970f5829044c34f288
|
|
| BLAKE2b-256 |
f5bece34b9f1d6e49433832e908289da1b7b3f5af1ed73c9bfc1620a40f027a1
|
File details
Details for the file fetch_papers_nishi-0.1.4-py3-none-any.whl.
File metadata
- Download URL: fetch_papers_nishi-0.1.4-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.11.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09d67abc0a45e60fda693ae7b58d5c8808f9d128388621b9818898b8c2cc993f
|
|
| MD5 |
41d4d0f5bbc71f185fa1e94f20ad2467
|
|
| BLAKE2b-256 |
b5b7ec91c801f4b9e517c643c13a6717ef686ce6318c9d14976d96321df43fae
|