Skip to content

ccameron/BibPMC

Repository files navigation

License Python package

BibPMC

bibpmc is a Python script that adds PubMed Central (PMC) unique identifiers (PMIDs and PMCIDs) to a BibTeX file, which is required for National Institute of Health (NIH) grant applications [1, 2, 3]. The script uses the digital object identifiers (DOI) in a provided BibTeX file to query the PMC API. If no DOIs are present, it will skip the query.

For validating PMC entries in a BibTeX file, see the pmcbib GitHub repository.

Software requirements

  1. Python v3.9+ interpreter
  2. Python package dependencies described in setup.py

Installation

bibpmc installation is expected to only take a few minutes.

Install using pip (recommended)

pip install git+https://github.com/ccameron/BibPMC.git@main

Install using conda

  1. Install Miniforge if the conda command is unavailable
  2. Create a new Python environment and install bibpmc using the environment file
conda env create -f "https://raw.githubusercontent.com/ccameron/BibPMC/refs/heads/main/environment.yml"
  1. Remove temporary or unused Conda files
conda clean --all -y
  1. Activate the bibpmc Python virtual environment
conda activate bibpmc

To check if bibpmc was correctly installed, run the following command:

bibpmc -h

bibpmc help documentation should appear in the terminal.

Quick start

To run bibpmc, use the following command:

bibpmc <email_address> /path/to/bibtex_file

Where:

  • <email_address> is your email address (required by the PubMed Central API)
  • /path/to/bibtex_file is the file path to the BibTeX file that you want to process

bibpmc will generate a new BibTeX file that includes the PMIDs and PMCIDs for the entries.

For an example of how to incorporate the updated BibTeX file into your LaTeX project, see the overleaf_example.zip compressed folder.

Command line details

usage: bibpmc [-h] [--include-existing] [--no-month-integer] [--out-bib out_bib] [--disable-file-logging] email in_bib

BibPMC: A Python script that adds PubMed Central identifiers to BibTeX files

positional arguments:
  email                 valid user email (required by PubMed Central API)
  in_bib                input BibTeX file path containing references

options:
  -h, --help            show this help message and exit
  --include-existing    include DOIs with existing PMID and PMCID from the BibTeX file in the PMC API query
  --no-month-integer    do not convert BibTeX month names to integers
  --out-bib out_bib     output BibTeX file path for updated references with PMIDs and PMCIDs
  --disable-file-logging
                        prevent log file creation and only print to console

Contact

Submitting a GitHub issue is preferred for all problems related to bibpmc.

About

BibPMC - add PubMed Central unique identifiers to a BibTeX file

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages