bibclean
A linter and formatter for BibTeX files, available as a command-line tool and as
pre-commit hooks. It rewrites a .bib file into a canonical style and reports what
it cannot rewrite, so that a bibliography stays readable in review and builds
without surprises with pybtex and sphinxcontrib-bibtex. Comments, @string macros,
@preamble blocks and unknown entry types are preserved, and a file with a block
that cannot be parsed is reported and never rewritten.
pip install bibclean
bibclean check doc/references.bib # report violations, never write
bibclean fix doc/references.bib # rewrite it in place
With uv, uvx bibclean check doc/references.bib runs
it without installing it. Example output:
doc/references.bib:14:3: strip-field field 'abstract' is not kept for @article [*]
doc/references.bib:27:1: duplicate-key cite key 'smith2020' is already defined as 'Smith2020' at line 3
doc/references.bib: file is not formatted, run `bibclean fix` [*]
Found 3 violations (2 fixable).
Two pre-commit hooks are available: bibclean-check reports and never writes,
bibclean-fix rewrites and fails when it did.
repos:
- repo: https://github.com/mscheltienne/bibclean
rev: 1.0.0
hooks:
- id: bibclean-fix
The documentation, including the canonical format, the fifteen rules and the configuration reference, is available here.
Metadata
Release files for bibclean 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bibclean-1.0.0.tar.gz | 252.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bibclean-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 296.7 kB
Release files / bibclean-1.0.0.tar.gz
| Download URL | bibclean-1.0.0.tar.gz |
|---|---|
| Size | 252.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a188bfabb726a86c9ab6922db5c81918deb8ec5e0533d6ff03c225d1fbc168e0
|
|
BLAKE2b-256 checksum How to use checksums |
d725d321e8c504ca9736723de9af95149b2e3eb562c2dce7b5990ec4c0a16510
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bibclean-1.0.0-py3-none-any.whl
| Download URL | bibclean-1.0.0-py3-none-any.whl |
|---|---|
| Size | 43.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8cab8a91ca5eb8ccbcb4ef0e230d01a4f20ffb20b8c1e90adc27bdd0808b0332
|
|
BLAKE2b-256 checksum How to use checksums |
2b37b1631e00e21d754effebf2b947a3fa16b2129aef85839d70957864577f9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|