This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Python-based tool for fetching academic publications from DBLP (Digital Bibliography & Library Project) and combining them into a single BibTeX file. The tool is designed for research groups to aggregate publications from multiple authors into one consolidated bibliography.
The entire application is contained in simple_dblp_fetcher.py - a standalone Python script with no external configuration files or complex dependencies. The design prioritizes simplicity and ease of use.
-
Author Loading (
load_authors)- Reads
authors.txtwhich contains author names and optional DBLP PIDs - Format:
Author Name, PID(one per line, comments allowed with#) - PIDs are used to disambiguate authors and avoid search API calls
- Reads
-
DBLP Integration
- Search API (
search_author): Finds author PIDs when not provided - BibTeX Endpoint (
fetch_bibtex): Downloads complete publication list for a PID - Base URL pattern:
https://dblp.org/pid/{PID}.bib
- Search API (
-
Rate Limiting & Retry Logic
- 3-second delay between author requests (see line 388)
- Retry mechanism with exponential backoff for HTTP 429 errors (lines 134-143)
- Max 3 retries with increasing wait times (5, 10, 15 seconds)
-
Year Filtering (
filter_bibtex_by_year)- Optional filtering by start/end year
- Parses year from BibTeX
year = {YYYY}field - Applied per-author before combining
-
Deduplication (
combine_bibtex)- Removes duplicate publications using BibTeX keys (e.g.,
DBLP:conf/sp/Paper2024) - Common when multiple authors from the same group co-author papers
- Tracks statistics: entries before/after deduplication
- Removes duplicate publications using BibTeX keys (e.g.,
# Fetch all publications for authors in authors.txt
python3 simple_dblp_fetcher.py
# Output: publications.bib# Publications from 2020-2024
python3 simple_dblp_fetcher.py --start 2020 --end 2024
# Publications from 2023 onwards
python3 simple_dblp_fetcher.py --start 2023
# Publications up to 2022
python3 simple_dblp_fetcher.py --end 2022# Custom authors file and output file
python3 simple_dblp_fetcher.py --authors team.txt --output my_pubs.bib# Only requires the requests library
pip install requestssimple_dblp_fetcher.py- Main script with all functionalityauthors.txt- Input file listing authors to fetch (one per line)publications.bib- Output file containing combined BibTeX entriesReadme.md- User documentation
- The script is designed to be self-contained - avoid adding external dependencies unless absolutely necessary
- When modifying API calls, respect DBLP's rate limits (currently 3-second delay between requests)
- Maintain backward compatibility with the
authors.txtformat
Since there are no automated tests, manual testing workflow:
# Test with a small authors.txt (1-2 authors)
python3 simple_dblp_fetcher.py --authors test_authors.txt --output test.bib
# Verify output:
# - Check console output for errors
# - Inspect test.bib for valid BibTeX format
# - Confirm publication counts match expectationsIMPORTANT: Do not add Claude as a co-author in git commits. When creating commits, use standard commit messages without the Co-Authored-By: Claude attribution.
- Rate limiting: Adjust
time.sleep(3)at line 388 and retry logic at lines 134-143 - API endpoints: DBLP URLs at lines 80 and 120
- Output format: Header generation in
combine_bibtex(lines 256-286) - Error handling: Each function has try/except blocks with logging
- PIDs in
authors.txtuse forward slash format:123/4567 - This maps to DBLP URL:
https://dblp.org/pid/123/4567 - PIDs can be found by searching author name on dblp.org
- Uses BibTeX keys (citation identifiers) to detect duplicates
- Key extraction at line 242: parses first line of entry for
{KEY, - Maintains insertion order, keeping first occurrence of each unique key
- Parses BibTeX entries by splitting on
@character (line 170) - Searches each entry for
year = {YYYY}pattern (lines 176-182) - Entries without parseable years are excluded from filtered results
The repository includes a GitHub Actions workflow (.github/workflows/update-publications.yml) that automatically updates publications.bib:
- Schedule: Runs twice a month on the 1st and 15th at 00:00 UTC (approximately every 2 weeks)
- Manual trigger: Can be triggered manually from GitHub Actions tab
- Behavior: Fetches publications from 2020 to current year, commits and pushes changes if publications.bib is updated
The workflow uses github-actions[bot] as the committer, so no personal credentials are needed.
To manually trigger the workflow:
- Go to GitHub repository → Actions tab
- Select "Update Publications" workflow
- Click "Run workflow" button
To change the schedule or year range, edit .github/workflows/update-publications.yml:
- Schedule: Modify the
cronexpression (line 5) - Year range: Change
--start 2020 --end $CURRENT_YEARin the workflow
This tool is designed to generate BibTeX files for the WordPress TeachPress plugin:
- Run script to generate
publications.bib - Upload to server or GitHub
- Configure TeachPress to import from URL
- Publications automatically appear on WordPress site
When modifying the output format, maintain compatibility with TeachPress's BibTeX parser.