pubmed-fetcher
is a Python tool designed to fetch research papers from PubMed and extract relevant information into CSV files. Below are the steps to run the program:
- If you dont already have poetry, run pip install poetry
- Clone the repository.
- Run : cd pubmed-fetcher
- Run : poetry install --no-root
- To use, use command : poetry run get-papers-list "YOUR QUERY" -f YOUR-FILE-NAME.csv -d
- If you don't want the file to be saved then you can skip the -f parameter, in which case the output will be printed to console.
- For help use: poetry run get-papers-list -h
- Fetch PubMed IDs based on a search query.
- Retrieve detailed XML data for given PubMed IDs.
- Extract and parse required fields from PubMed XML data into CSV files.
-
Ensure you have Poetry installed. If not, you can install it using pip:
pip install poetry
-
Clone the repository:
git clone https://github.com/November-6/pubmed-fetcher.git
-
Change to the project directory:
cd pubmed-fetcher
-
Install dependencies:
poetry install --no-root
To fetch research papers from PubMed, use the command:
poetry run get-papers-list "YOUR QUERY" -f YOUR-FILE-NAME.csv -d
- Replace
"YOUR QUERY"
with your search query. - Replace
YOUR-FILE-NAME.csv
with the desired output CSV file name. - If you don't want the file to be saved, you can skip the
-f
parameter, and the output will be printed to the console.
For help, use:
poetry run get-papers-list -h
To fetch papers related to "cancer research" and save the results to results.csv
:
poetry run get-papers-list "cancer research" -f results.csv
To fetch papers related to "cancer research" and print the results to the console:
poetry run get-papers-list "cancer research"
pubmed_fetcher.py
: Contains the core functions for fetching and parsing PubMed data.pubmed_cli.py
: Command-line interface for interacting with the tool.poetry.lock
: Lock file generated by Poetry for managing dependencies.
This project is licensed under the MIT License.
For any inquiries or issues, feel free to contact me at [email protected].