Skip to main content

bibla

https://github.com/MrClassicT/bibla/actions/runs/9430255754/artifacts/1581991547 flake8 bibla is a minimalistic linter (style checker) for biblatex files with support for libraries managed by JabRef.

bibla does not come with its own biblatex parser, but leverages the pybtex parser.

Bibla is an extension of bibl, which was made by Arne Van Den Kerckhove. The original Bibl can be found here. I do not claim any form of ownership over the original Bibl, I have only made some changes to it. Those changes I do claim ownership over. Just like the original Bibl, this will also be licensed under the MIT license.

Installation

pip install bibla

Usage - This still needs to receive an update!

Run bibla on your biblatex files with the following command

bibla lint bibliography1.bib

or

bibla lint bibliography1.bib bibliography2.bib ... 

or as a python module with

python -m bibla lint bibliography1.bib bibliography2.bib ... 

bibla will check these files for a variety of style issues and deviations from the biblatex spec (http://www.biblatex.org/Format/, https://en.wikipedia.org/wiki/biblatex). Each possible type of issue is formulated as a rule. Each rule is identified by a unique code. Some examples of rules are

Rule ID Rule description
U00 Unrecognized entry type
T01 Non-standard whitespace at beginning of line (indents should be 2 spaces)
T02 Whitespace at end of line
M01OnlineUrl Missing required field url for entry type online
M02InbookPages Missing optional field pages for entry type inbook
E08 pages field formatting is incorrect. Please use the following format: 123--456. In ascending order seperated with two dashes.
E09 Entry should use correct date format: YYYY-MM-DD, YYYY-MM or YYYY!
E10ArticleJournal Use journaltitle instead of journal!
... ...

This link provides a list of all available rules generated with the default configuration (see Configuration section below).

The first character of a rule id refers to a rules category, e.g. E for issues with entry values, T for textual issues with the .bib file, etc. NOTE: The following does not work yet due to having a fixed set ignore in the general config, this will be fixed! - May 18th, 2024 You can specify which rules to check by using --select or --ignore. Wildcards are allowed. --select will only enable the specified rules, disabling all other rules, while --ignore will disable all rules except the ones specified. --select and --ignore may not be specified simultaneously.

bibla --select "D*,E06,T01" lint bibliography.bib

will only check all rules starting with D, rule E06 and rule T01

bibla --ignore "D*,E06,T01" lint bibliography.bib

will check all rules except all rules starting with D, rule E06 and rule T01

Configuration

Aside from --select and --ignore, other configuration options can be provided via the cli, like --max-line-length to specify the line length for which an issue should be reported if exceeded. See below for a full list.

Configuration can also be specified in a yaml format configuration file, provided by the --config option. If no configuration file is provided and a bibla.yml or .bibla.yml file is present in the current working directory, this file will be used as a configuration file. Command line option configuration will override configuration provided by a file. See the default configuration bibla.yml for all values that can be overwritten in a configuration file.

Some rules, like the various M01*, M02* and U01* rules, are procedurally generated based on the type_spec setting. This setting specifies which entry and field types should be present and can be modified to more easily ignore generated rules for specific entry types or fields, or to add custom fields or entry types for which warnings should be given while linting.

CLI

Usage: bibla [OPTIONS] COMMAND [ARGS]...

Options:
  -c, --config TEXT          Custom configuration file path.
  --select TEXT              Comma separated list of enabled rules, all other
                             rules will be disabled.

  --ignore TEXT              Comma separated list of disabled rules, all other
                             rules will be enabled.

  --indent-spaces INTEGER    Number of trailing whitespaces for indented line,
                             used by TO1.

  --max-line-length INTEGER  Max line length before wrap recommended, used by
                             T03.

  --abbreviation-dot         Abbreviate middle names with dot.
  --help                     Show this message and exit.

Commands:
  lint          Lint a biblatex bibliography file.
  list-all      Show all available rules.
  list-enabled  Show all rules enabled by the configuration.
  version       Show the package version.
Usage: bibla lint [OPTIONS] [BIBLIOGRAPHY]...

  Lint a biblatex bibliography file.

Options:
  --help  Show this message and exit.
Usage: bibla list-all [OPTIONS]

  Show all available rules.

Options:
  -m      Format rules as markdown table.
  --help  Show this message and exit.
Usage: bibla list-enabled [OPTIONS]

  Show all rules enabled by the configuration.

Options:
  -m      Format rules as markdown table.
  --help  Show this message and exit.

Metadata

Release files for bibla 2.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bibla 2.0.11
File Size Uploaded
bibla-2.0.11.tar.gz 29.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bibla 2.0.11
File Interpreter ABI Platform
bibla-2.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 50.8 kB

Release files / bibla-2.0.11.tar.gz

Download URL bibla-2.0.11.tar.gz
Size 29.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cdfc359a6b5516830d174978852cda22adbc5777f82834846e6f45293524c336
BLAKE2b-256 checksum
How to use checksums
c4c70da1db7c589ef55112ae9a7dbe50cdb00730fd312657e92f2b57e9ae2828
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / bibla-2.0.11-py3-none-any.whl

Download URL bibla-2.0.11-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e8361deb7c6af4d173579100b7fb3992ab20b2cbc134d9944d7a26fb5c67337
BLAKE2b-256 checksum
How to use checksums
550e9fa056061c8f0ce80cfe59f9697880b5b61bb3427a974d69efb4c219dc01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

2.0.11 This release

2 release files

2.0.10

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

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