Bib Cleaner
Bib Cleaner removes unnecessary entries from your bib files. Documentation @ https://bib-cleaner.readthedocs.io.
Use case
You have been writing a TeX document for a while, and adding citation entries to your .bib file (say it’s called master.bib).
In the course of writing, some entries in your master.bib have become obsolete. You don’t use them in your TeX document anymore.
Of course, LaTeX compiles quite happily with these extra entries.
You take a step back, sip some coffee, go for a walk, all the while pondering “Man, I wish I could just remove those extra bib entries”. You yearn for a world where all .bib files everywhere carry only what they have to, and no more.
I gotchu. Enter bib_cleaner.
Installation
This should work:
$ pip install bib_cleaner
Verify if it installed by typing the following in the command-line:
$ bib_cleaner -h
You should see the help:
usage: bib_cleaner [-h] [-t TEXFILES [TEXFILES ...]] [-o OUTPUTBIB] masterfile
Produce a minimal bib file with only the entries found in your .tex file(s)
positional arguments:
masterfile master bib file with used and unused citations (.bib)
optional arguments:
-h, --help show this help message and exit
-t TEXFILES [TEXFILES ...], --texfiles TEXFILES [TEXFILES ...]
content files to select entries from (.tex)
-o OUTPUTBIB, --outputbib OUTPUTBIB
output file name with extension
Examples
After installation, navigate to your TeX directory try:
$ bib_cleaner master.bib
Of course, replace master.bib with the name of your bib file with obsolete bib entries. bib_cleaner will automatically detect all the TeX files (.tex) in that directory and use them to determine which bib entries are obsolete.
Specify TeX files
If you only want to use some TeX files, specify them with:
$ bib_cleaner master.bib --texfiles chapter1.tex chapter2.tex
or:
$ bib_cleaner master.bib -t chapter1.tex chapter2.tex
Specify output file name
If you want to change the output bib file name from the default new.bib, do:
$ bib_cleaner master.bib -t chapter1.tex --outputbib chapter1.bib
or:
$ bib_cleaner master.bib -t chapter1.tex -o chapter1.bib
TODO
Remove typically unused lines from .bib files (like file = {...} or abstract = {...})
Detect and remove bib entries with identical tags / raise conflict
Add tests for the command-line interface
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.3.0 (2019-12-20)
Added
Option to store output in new.bib
Intro and examples to README.rst
0.2.1 (2019-12-20)
Added
get_minimal_bibs function.
tests for tex_to_tags and get_minimal_bibs.
Fixed
Documentation builds.
Deploy from Travis.
Removed
Support for Python 3.5 (no f-string support)
0.1.0 (2019-12-16)
First release on PyPI.
Metadata
Release files for bib-cleaner 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bib_cleaner-0.3.2.tar.gz | 13.3 kB | Without provenance | Details for bib_cleaner-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bib_cleaner-0.3.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for bib_cleaner-0.3.2-py2.py3-none-any.whl |
Total release size: 20.3 kB
Release files / bib_cleaner-0.3.2.tar.gz
| Download URL | bib_cleaner-0.3.2.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
518e1fac8df48b7daeb4d9ad327300065f780ccb7babb728a882e76357d135a8
|
|
BLAKE2b-256 checksum How to use checksums |
216ff8895354511d941cacf32bc709cbd41fcd156dd937ad0843b7f5a8d0874b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0
|
Release files / bib_cleaner-0.3.2-py2.py3-none-any.whl
| Download URL | bib_cleaner-0.3.2-py2.py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
3f4b3668cbbaaa84282609d904b56170f00fc05216d4c8b082aa995b138ecbd2
|
|
BLAKE2b-256 checksum How to use checksums |
45ec81597b486496279857ab001a5157175ae92b5e593da4b0f031438815e9a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0
|
Security for bib-cleaner 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.