A Python script for merging multiple BibTeX .bib
files, resolve conflicts, and removes duplicates.
python bib-merger.py [options] input1.bib [input2.bib input3.bib ...] output.bib
input1.bib
,input2.bib
, etc.: Input BibTeX files to merge/examineoutput.bib
: Output file for merged entries--no-interactive
: (Optional) Run in non-interactive mode, automatically choosing entries when conflicts occur--overwrite
: (Optional) Overwrite the output file without asking for confirmation
# Interactive mode (default)
python bib-merger.py file1.bib file2.bib output.bib
# Non-interactive mode
python bib-merger.py --no-interactive file1.bib file2.bib output.bib
- Consistency checks:
- Articles with the same title & type should have the same key
- Articles with the same key should have the same title & type
- Note: conference/ journal/ preprint article with the same title are considered different articles
- In interactive mode, it prompts the user to resolve conflicts
- In non-interactive mode, it automatically chooses entries based on their first appearance
- e) or automatic selection (non-interactive mode)
- If the title field contains comma (
,
), it might be truncated when parsing title. This parsed title field is only used for consistency checks. The final output is not affected.
This project is open source and available under the MIT License.