A Python package to fetch research papers from PubMed
Project description
PubMed Fetcher
Overview
PubMed Fetcher is a command-line tool that allows users to search PubMed for research articles and retrieve relevant data programmatically. It is designed for researchers, developers, and data analysts who need to automate literature searches.
Features
- Fetches research articles from PubMed based on user queries.
- Provides structured output in JSON format.
- CLI-based interaction for ease of use.
- Supports advanced search queries.
Installation
Prerequisites
- Python 3.13+
- Poetry (for dependency management)
Steps to Install
- Clone the repository:
git clone https://github.com/yourusername/pubmed_fetcher.git cd pubmed_fetcher
- Install dependencies using Poetry:
poetry install - Activate the virtual environment:
poetry shell
Usage
Running the CLI
To search for research articles on a specific topic:
poetry run python src/cli.py "Machine Learning"
Running Tests
Run unit tests using pytest:
poetry run pytest tests/
How It Works
-
CLI Execution:
- User provides a search term.
- The CLI interacts with the PubMed API.
- The results are fetched and displayed.
-
PubMed API Interaction:
- Queries PubMed using
requests. - Parses and formats the response.
- Queries PubMed using
-
Output Handling:
- Results are printed in a readable format.
- Can be exported as JSON.
Troubleshooting
Common Issues
- CLI output is None: Ensure you are running the command correctly with a valid query.
- Encoding errors in Windows: Run the following before executing the script:
set PYTHONUTF8=1
Contributing
- Fork the repository.
- Create a new branch:
git checkout -b feature-new-feature
- Commit changes:
git commit -m "Add new feature"
- Push and create a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For questions, reach out via GitHub Issues or email at abhichandrav108@gmail.com.
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 pubmed_fetcher_abhichandra-0.1.5.tar.gz.
File metadata
- Download URL: pubmed_fetcher_abhichandra-0.1.5.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.1 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46ffe4c1ed14695c43a50f67ad197237130d6b7e41104024359d5183e294cfcf
|
|
| MD5 |
3d687a3a8aec98c4132e7956137dfd06
|
|
| BLAKE2b-256 |
c2f9a7f12ce737387fc66c93683a6cb3b18682f95f2beddac4cfc81e5daa0a96
|
File details
Details for the file pubmed_fetcher_abhichandra-0.1.5-py3-none-any.whl.
File metadata
- Download URL: pubmed_fetcher_abhichandra-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.1 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd84df669b914d8474b3d69affe3dae921fa074524ec44995df88735936942a3
|
|
| MD5 |
6c6ba9caaa1bcd0dbd843a260584d907
|
|
| BLAKE2b-256 |
cee470f023784e16254e4ffc13f06e5904cf8e48d7c46d7c5a6e0aa85b293231
|