Skip to main content

A tool to fetch research papers with non-academic authors from PubMed

Project description

Bio-Info

A Python tool to fetch research papers from PubMed and identify those with authors affiliated with pharmaceutical or biotech companies.

Features

  • Search PubMed using the full PubMed query syntax
  • Identify papers with authors affiliated with pharmaceutical or biotech companies
  • Extract corresponding author emails
  • Output results to CSV or console

Code Organization

The project is organized as follows:

  • bio_info/: Main package directory
    • __init__.py: Package initialization
    • api.py: Module for interacting with the PubMed API
    • affiliations.py: Module for identifying non-academic authors and company affiliations
    • output.py: Module for generating and formatting CSV output
    • cli.py: Command-line interface implementation
  • tests/: Test directory
    • test_bio_info.py: Unit tests for the package

Installation

This project uses Poetry for dependency management.

  1. Make sure you have Python 3.8+ and Poetry installed
  2. Clone the repository
git clone https://github.com/yourusername/pubmed-papers.git
cd pubmed-papers
  1. Install dependencies
poetry install

Usage

After installation, you can use the get-papers-list command to search for papers:

# Basic usage, prints results to console
poetry run get-papers-list "cancer therapy"

# Save results to a CSV file
poetry run get-papers-list "artificial intelligence AND medicine" -f results.csv

# Enable debug mode
poetry run get-papers-list "COVID-19 vaccine" -d

# Limit results (default is 100)
poetry run get-papers-list "gene therapy" -m 50

Command Line Arguments

  • query: PubMed search query (enclose in quotes for complex queries)
  • -h, --help: Show help message and exit
  • -f, --file: Specify the filename to save the results (if not provided, print to console)
  • -d, --debug: Print debug information during execution
  • -m, --max-results: Maximum number of results to fetch from PubMed (default: 100)

Dependencies

This project uses the following key libraries:

  • Biopython: For accessing the PubMed API
  • Pandas: For data manipulation and CSV handling
  • Requests: For HTTP requests

Development

Running Tests

poetry run pytest

Tools Used

The following tools were used in the development of this project:

  • Poetry: Dependency management
  • Pytest: Testing framework
  • Black: Code formatting
  • MyPy: Static type checking

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

bio_info_pubmed-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

bio_info_pubmed-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bio_info_pubmed-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for bio_info_pubmed-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60b9bb1e9a978ad4cca2e6f0df67a586328518605830fb56107ed69b7690482e
MD5 106508843b91a177a5aa2c83581c8fa6
BLAKE2b-256 5e0a1ebb061130b185a28f322fd6b989f1ceebf5b56e07235104de8cacc077a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bio_info_pubmed-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for bio_info_pubmed-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 151e86d64f422d609df2adfc0da6a23486bc0dae86a74ee6096e194fae6dd18f
MD5 b09d915b6eddbe336dafa4a19637231e
BLAKE2b-256 585fa22bcf2a48b2382b55d3c53d818b4a9baafda38437de4df92b7cc5f9bb5b

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