Skip to main content

Ruff codecov tests doc PyPI version Downloads

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)

Source distribution for bibclean 1.0.0
File Size Uploaded
bibclean-1.0.0.tar.gz 252.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bibclean 1.0.0
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page