A CLI tool for sanity checking BibTeX entries
Project description
BibSanity
Experimental note: This project started as a one-day, vibe-coded experiment. Expect rough edges.
A CLI tool to sanity-check BibTeX entries and flag likely invalid citations or inconsistent metadata.
Features
- Hybrid Verification Logic: DOI lookup via Crossref API, falling back to title search via OpenAlex API
- Multiple Report Formats: Terminal output (Rich tables), JSON, and HTML reports
- Organized Output: Reports are saved in
Sanity_Reportnext to the input file - Caching: Caches API responses to reduce redundant requests
- Concurrent Processing: Verifies multiple entries in parallel
- Conservative Language: Uses FAIL/WARN/OK statuses with clear reasons
Installation
From source (recommended for now):
pip install -e .
Quickstart
bibsanity check examples/test_refs.bib
Options
--format, -f FORMAT: Output format:json,html, orall(default:json)--json, -j PATH: Custom path for JSON report (default: saved inSanity_Report)--out, -o PATH: Custom path for HTML report (deprecated; use--formatinstead)--max-workers, -w N: Maximum concurrent workers (default: 6)--strict, -s: Use strict verification mode (treats warnings as failures)--no-cache: Disable caching
Examples
# Basic check (generates JSON report in Sanity_Report folder)
bibsanity check examples/test_refs.bib
# Generate HTML report
bibsanity check references.bib --format html
# Generate all formats (JSON + HTML)
bibsanity check references.bib --format all
# Custom JSON report path
bibsanity check references.bib --json custom_report.json
# Strict mode with more workers
bibsanity check references.bib --strict --max-workers 10
Report Location
Reports are automatically saved in a Sanity_Report folder next to your input file:
references.bib
Sanity_Report/
├── references_report.json
└── references_report.html
Verification Logic
-
DOI-based verification (if DOI is present):
- Looks up the DOI in Crossref API
- Compares title, year, and authors
- Returns OK if metadata matches, WARN/FAIL if inconsistencies found
-
Title-based verification (if no DOI or DOI lookup fails):
- Searches OpenAlex API by title
- Uses fuzzy matching to find best match
- Compares year and authors
- Returns OK if good match found, WARN/FAIL if inconsistencies found
-
Failure cases:
- No DOI and no title match found
- Metadata inconsistencies (year, authors, title mismatch)
Known Limitations / Possible False Positives
- Old papers published in conferences and journals with highly similar titles.
- Titles with special characters such as
$$or LaTeX equations. - Non-English papers or journals that are not indexed in Crossref or OpenAlex.
Report Formats
Terminal Report
Rich-formatted table showing entry ID, status, and reason.
JSON Report
Structured JSON with summary statistics and detailed results for each entry.
HTML Report
Styled HTML report with summary cards and detailed table (generated when --format html or --format all is used).
Status Codes
- OK: Entry verified successfully with matching metadata
- WARN: Entry found but metadata inconsistencies detected
- FAIL: Entry could not be verified or strict mode violations
Exit Codes
0: Completed with no FAIL results1: Errors or one or more FAIL results
Requirements
- Python 3.9+
- Internet connection (for API calls to Crossref and OpenAlex)
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bibsanity-0.1.0.tar.gz.
File metadata
- Download URL: bibsanity-0.1.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fac50d9b8d617f7c1224c425dc22838908058c762f7f048418cde2e8902fbad7
|
|
| MD5 |
7a8bad31e36c02a002524fc069e4fae5
|
|
| BLAKE2b-256 |
d4413250affd69955f687ff2f56df1ad845560bcf96f3cc6bbd12506902a6797
|
Provenance
The following attestation bundles were made for bibsanity-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on Y1kee/BibSanity
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bibsanity-0.1.0.tar.gz -
Subject digest:
fac50d9b8d617f7c1224c425dc22838908058c762f7f048418cde2e8902fbad7 - Sigstore transparency entry: 834517256
- Sigstore integration time:
-
Permalink:
Y1kee/BibSanity@bf235849a53142bfa69609db14a201f13ed9bb19 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Y1kee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@bf235849a53142bfa69609db14a201f13ed9bb19 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file bibsanity-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bibsanity-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4083d5fbfde922e714a2c634fbcdbd3c8b1561ce22f721abbcecc743a977f80
|
|
| MD5 |
9cd9165cc19a566e516e2c361ae8afb0
|
|
| BLAKE2b-256 |
fcd1c8d29b81de61daf9bbc391ad0e4747033927aa20b6921315a00618033148
|
Provenance
The following attestation bundles were made for bibsanity-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on Y1kee/BibSanity
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bibsanity-0.1.0-py3-none-any.whl -
Subject digest:
b4083d5fbfde922e714a2c634fbcdbd3c8b1561ce22f721abbcecc743a977f80 - Sigstore transparency entry: 834517262
- Sigstore integration time:
-
Permalink:
Y1kee/BibSanity@bf235849a53142bfa69609db14a201f13ed9bb19 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Y1kee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@bf235849a53142bfa69609db14a201f13ed9bb19 -
Trigger Event:
workflow_dispatch
-
Statement type: