{"id":41959721,"url":"https://github.com/rpatrik96/bibtexupdater","last_synced_at":"2026-02-01T11:03:20.848Z","repository":{"id":334604844,"uuid":"1107066205","full_name":"rpatrik96/bibtexupdater","owner":"rpatrik96","description":"Tools for managing BibTeX bibliographies: automatically update preprints to published versions and filter to only cited references.","archived":false,"fork":false,"pushed_at":"2026-01-25T20:54:33.000Z","size":231,"stargazers_count":46,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-26T11:57:58.049Z","etag":null,"topics":["bibtex","bibtex-references","bibtexparser","latex"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpatrik96.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-30T14:13:23.000Z","updated_at":"2026-01-26T10:49:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rpatrik96/bibtexupdater","commit_stats":null,"previous_names":["rpatrik96/bibtexupdater"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rpatrik96/bibtexupdater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fbibtexupdater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fbibtexupdater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fbibtexupdater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fbibtexupdater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpatrik96","download_url":"https://codeload.github.com/rpatrik96/bibtexupdater/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fbibtexupdater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28977316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T09:57:52.632Z","status":"ssl_error","status_checked_at":"2026-02-01T09:57:49.143Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bibtex","bibtex-references","bibtexparser","latex"],"created_at":"2026-01-25T22:54:05.764Z","updated_at":"2026-02-01T11:03:20.832Z","avatar_url":"https://github.com/rpatrik96.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BibTeX Updater\n\nTools for managing BibTeX bibliographies: automatically update preprints to published versions, validate references against external databases, and filter to only cited references.\n\n## Installation\n\n### From PyPI (Recommended)\n\n```bash\npip install bibtex-updater\n\n# With Google Scholar support\npip install bibtex-updater[scholarly]\n\n# With Zotero support\npip install bibtex-updater[zotero]\n\n# All optional dependencies\npip install bibtex-updater[all]\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/rpatrik96/bibtexupdater.git\ncd bibtexupdater\npip install -e \".[dev]\"\n```\n\n### Using uv (No Installation)\n\nRun directly without managing virtual environments using [uv](https://docs.astral.sh/uv/):\n\n```bash\n# Run any command directly\nuv run --with \"bibtex-updater[all]\" bibtex-update references.bib -o updated.bib\n\n# Or use the provided wrapper script\n./scripts/bibtex-x update references.bib -o updated.bib\n./scripts/bibtex-x check references.bib\n./scripts/bibtex-x filter paper.tex -b references.bib -o filtered.bib\n```\n\n## CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `bibtex-update` | Replace preprints with published versions |\n| `bibtex-check` | Validate references exist with correct metadata |\n| `bibtex-filter` | Filter to only cited entries |\n| `bibtex-zotero` | Update preprints in Zotero library |\n\n## Quick Start\n\n### Update Preprints\n\n```bash\n# Update preprints to published versions\nbibtex-update references.bib -o updated.bib\n\n# Preview changes (dry run)\nbibtex-update references.bib --dry-run --verbose\n```\n\n### Validate References (Fact-Check)\n\n```bash\n# Check if references exist and have correct metadata\nbibtex-check references.bib --report report.json\n\n# Strict mode: exit with error if hallucinated/not-found entries\nbibtex-check references.bib --strict\n```\n\n### Filter Bibliography\n\n```bash\n# Filter to only cited entries\nbibtex-filter paper.tex -b references.bib -o filtered.bib\n\n# Multiple tex files\nbibtex-filter *.tex -b references.bib -o filtered.bib\n```\n\n### Update Zotero Library\n\n```bash\n# Set credentials (get from zotero.org/settings/keys)\nexport ZOTERO_LIBRARY_ID=\"your_user_id\"\nexport ZOTERO_API_KEY=\"your_api_key\"\n\n# Preview changes\nbibtex-zotero --dry-run\n\n# Apply updates\nbibtex-zotero\n```\n\n### Sync BibTeX Updates to Zotero\n\nWhen updating a `.bib` file, you can simultaneously update matching entries in your Zotero library:\n\n```bash\n# Set Zotero credentials\nexport ZOTERO_LIBRARY_ID=\"your_user_id\"\nexport ZOTERO_API_KEY=\"your_api_key\"\n\n# Update bib file AND sync to Zotero\nbibtex-update references.bib -o updated.bib --zotero\n\n# Preview Zotero changes only (bib changes still apply)\nbibtex-update references.bib -o updated.bib --zotero --zotero-dry-run\n\n# Limit to a specific Zotero collection\nbibtex-update references.bib -o updated.bib --zotero --zotero-collection ABCD1234\n```\n\nThe sync matches bib entries to Zotero items by:\n1. **arXiv ID** - Most reliable for preprints\n2. **DOI** - For preprints with DOIs (e.g., bioRxiv)\n3. **Title + Author** - Fuzzy matching as fallback\n\n## Standalone Scripts\n\nFor environments without pip (e.g., Overleaf), `filter_bibliography.py` can be used directly as it has no dependencies:\n\n```bash\n# Copy the script and run directly\npython filter_bibliography.py paper.tex -b references.bib -o filtered.bib\n```\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [docs/BIBTEX_UPDATER.md](docs/BIBTEX_UPDATER.md) | Full BibTeX updater documentation |\n| [docs/REFERENCE_FACT_CHECKER.md](docs/REFERENCE_FACT_CHECKER.md) | Full reference fact-checker documentation |\n| [docs/ZOTERO_UPDATER.md](docs/ZOTERO_UPDATER.md) | Full Zotero updater documentation |\n| [docs/FILTER_BIBLIOGRAPHY.md](docs/FILTER_BIBLIOGRAPHY.md) | Full filter documentation |\n| [examples/](examples/) | Example workflows and configuration files |\n\n## Overleaf Integration\n\nBoth tools integrate with Overleaf via GitHub Actions or latexmkrc.\n\n### GitHub Actions (Recommended)\n\n1. Enable GitHub sync in Overleaf (Menu -\u003e Sync -\u003e GitHub)\n2. Copy a workflow from [examples/workflows/](examples/workflows/) to `.github/workflows/`\n3. Changes synced from Overleaf automatically trigger updates\n\n### latexmkrc (Direct Overleaf)\n\nFor `filter_bibliography.py` only (no dependencies required):\n\n1. Upload `filter_bibliography.py` to your Overleaf project\n2. Create `.latexmkrc` based on [examples/latexmkrc](examples/latexmkrc)\n3. Recompile - filtered bibliography appears in your file list\n\n## Features\n\n### BibTeX Updater (`bibtex-update`)\n\n- **Multi-source resolution**: arXiv, Crossref, DBLP, Semantic Scholar, Google Scholar\n- **High accuracy**: Title and author fuzzy matching with confidence thresholds\n- **Batch processing**: Multiple files with concurrent workers (default: 8)\n- **Deduplication**: Merge duplicates by DOI or normalized title+authors\n- **Smart caching**: On-disk cache + semantic resolution cache with TTL\n- **Per-service rate limiting**: Optimized rate limits per API (Crossref, S2, DBLP, arXiv)\n- **Batch API support**: Faster bulk lookups via arXiv/S2/Crossref batch endpoints\n\n### Zotero Updater (`bibtex-zotero`)\n\n- **Direct Zotero integration**: Fetches and updates items via Zotero API\n- **Same resolution pipeline**: Uses the same multi-source resolution\n- **Preserves metadata**: Keeps notes, tags, and attachments intact\n- **Idempotent**: Already-published papers are automatically skipped\n- **Dry-run mode**: Preview changes before applying\n\n### Reference Fact-Checker (`bibtex-check`)\n\n- **Multi-source validation**: Crossref, DBLP, Semantic Scholar\n- **Detailed mismatch detection**: Title, author, year, venue comparisons\n- **Hallucination detection**: Identifies likely fabricated references\n- **Structured reports**: JSON and JSONL output formats\n- **CI/CD integration**: Strict mode with exit codes for automation\n\n### Filter Bibliography (`bibtex-filter`)\n\n- **Zero dependencies**: Uses only Python standard library\n- **Works on Overleaf**: No pip install needed\n- **Multiple bib files**: Merge and filter from multiple sources\n- **Citation detection**: Supports natbib, biblatex, and standard LaTeX citations\n\n## Python API\n\n```python\nfrom bibtex_updater import Detector, Resolver, Updater, HttpClient, RateLimiter, DiskCache\n\n# Create HTTP client with rate limiting and caching\nrate_limiter = RateLimiter(req_per_min=30)\ncache = DiskCache(\".cache.json\")\nhttp_client = HttpClient(\n    timeout=30.0,\n    user_agent=\"bibtex-updater/0.1.0\",\n    rate_limiter=rate_limiter,\n    cache=cache\n)\n\n# Detect preprints\ndetector = Detector()\ndetection = detector.detect(entry)\n\nif detection.is_preprint:\n    # Resolve to published version\n    resolver = Resolver(http_client)\n    candidate = resolver.resolve(detection)\n\n    if candidate and candidate.confidence \u003e= 0.9:\n        # Update the entry\n        updater = Updater()\n        updated_entry = updater.update_entry(entry, candidate.record, detection)\n```\n\n## Development\n\n```bash\n# Clone and install in development mode\ngit clone https://github.com/rpatrik96/bibtexupdater.git\ncd bibtexupdater\npip install -e \".[dev,all]\"\n\n# Run tests\npytest tests/ -v\n\n# Run tests with coverage\npytest tests/ -v --cov=bibtex_updater --cov-report=term-missing\n\n# Code quality\npre-commit run --all-files\n\n# Build package\npython -m build\n\n# Check package\ntwine check dist/*\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpatrik96%2Fbibtexupdater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpatrik96%2Fbibtexupdater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpatrik96%2Fbibtexupdater/lists"}