betterbib


Namebetterbib JSON
Version 7.5.25 PyPI version JSON
download
home_pageNone
SummaryBetter bibliography data
upload_time2025-08-03 14:08:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords bibtex latex
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img alt="betterbib" src="https://raw.githubusercontent.com/texworld/betterbib/assets/betterbib.svg" width="60%">
</p>

[![PyPi Version](https://img.shields.io/pypi/v/betterbib.svg?style=flat-square)](https://pypi.org/project/betterbib)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/betterbib.svg?style=flat-square)](https://pypi.org/pypi/betterbib/)
[![GitHub stars](https://img.shields.io/github/stars/texworld/betterbib.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/texworld/betterbib)

<!-- [![Downloads](https://pepy.tech/badge/betterbib/month?style=flat-square)](https://pepy.tech/project/betterbib) -->
<!--[![PyPi downloads](https://img.shields.io/pypi/dm/betterbib.svg?style=flat-square)](https://pypistats.org/packages/betterbib)-->

[![Discord](https://img.shields.io/static/v1?logo=discord&logoColor=white&label=chat&message=on%20discord&color=7289da&style=flat-square)](https://discord.gg/hnTJ5MRX2Y)

> [!NOTE]
> See [here](https://github.com/texworld) for licensing information.

Bibliography files are notoriously hard to work with. Betterbib contains
a number of easy-to-use command-line tools to help.

- [`betterbib convert`](#convert) converts between different bibliography formats, e.g.

  - [BibTeX](https://www.bibtex.org/Format/)
  - [BibLaTeX](https://ctan.org/pkg/biblatex)
  - [RIS](<https://en.wikipedia.org/wiki/RIS_(file_format)>)
  - [CSL-JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)

- [`betterbib sync`](#sync) syncs bibliography data with a number of online sources, e.g.,

  - [Crossref](https://www.crossref.org/)
  - [DBLP](https://dblp.uni-trier.de/)
  - [PubMed](https://pubmed.ncbi.nlm.nih.gov/)
  - [arXiv](https://arxiv.org/)
  - [Zenodo](https://zenodo.org/)

- [`betterbib format`](#format) formats your bibliography files to your liking.
  Can also (un)abbreviate author and journal names.

- [`betterbib doi-to`](#dereference-dois) converts a DOI or DOI URL to a bibliography entry.

### Installation

Install betterbib [from PyPI](https://pypi.org/project/betterbib/) with

<!--pytest.mark.skip-->

```
pip install betterbib
```

#### Convert

#### Sync

Simply run

<!--pytest.mark.skip-->

```sh
betterbib sync in.bib
```

to sync your bibliography file with online sources. For example, the input

```bibtex
@article{wiles,
title={Fermat Last Theorem},
doi={10.2307/2118559},
}
```

is converted to

```bibtex
@article{wiles,
  number = {3},
  doi = {10.2307/2118559},
  pages = {443},
  source = {Crossref},
  volume = {141},
  author = {Wiles, Andrew},
  year = {1995},
  month = may,
  url = {https://doi.org/10.2307/2118559},
  issn = {0003-486X},
  journal = {The Annals of Mathematics},
  publisher = {JSTOR},
  title = {Modular Elliptic Curves and Fermat's Last Theorem},
}
```

See `-h`/`--help` for all options.

<!--pytest.mark.skipif(sys.version_info < (3, 11), reason="Need Python 3.11+")-->

```sh
betterbib sync -h
```

<!--pytest-codeblocks: expected-output-ignore-whitespace-->

```
Usage: betterbib sync [-h] [-i] [-c N] [-s SRC] [-m MINIMUM_SCORE] [-q] [--debug]
                      [--output-format {bibtex,biblatex,csl-json,ris}]
                      infiles [infiles ...]

Positional Arguments:
  infiles               input bibliography files

Options:
  -h, --help            show this help message and exit
  -i, --in-place        modify infile in place
  -c, --num-concurrent-requests N
                        number of concurrent HTTPS requests (default: 1)
  -s, --sources SRC     sources to try (comma-separated, with order; default:
                        crossref,dblp,pubmed)
  -m, --minimum-score MINIMUM_SCORE
                        minimum score to count as a match (default: 0.0)
  -q, --quiet           don't show progress info (default: show)
  --debug               some debug output (default: false)
  --output-format {bibtex,biblatex,csl-json,ris}
                        force output format (default: same as input)
```

#### Format

After that, you can for example run

```
betterbib format in.bib --sort-fields --align-values --journal-names short --abbrev-first-names
```

to get

```bibtex
@article{wiles,
  author    = {Wiles, A.},
  doi       = {10.2307/2118559},
  issn      = {0003-486X},
  journal   = {Ann. Math.},
  month     = may,
  number    = {3},
  pages     = {443},
  publisher = {JSTOR},
  source    = {Crossref},
  title     = {Modular Elliptic Curves and Fermat's Last Theorem},
  url       = {https://doi.org/10.2307/2118559},
  volume    = {141},
  year      = {1995},
}
```

```sh
betterbib format -h
```

<!--pytest.mark.skipif(sys.version_info < (3, 11), reason="Need Python 3.11+")-->

```
Usage: betterbib format [-h] [-i] [--drop DROP] [--journal-names {long,short,unchanged}] [--abbrev-first-names]
                        [--sort-entries] [--sort-fields] [--doi-url-type {unchanged,old,new,short}]
                        [--page-range-separator PAGE_RANGE_SEPARATOR] [--protect-title-capitalization]
                        [--indent [INDENT]] [--align-values]
                        infiles [infiles ...]

Positional Arguments:
  infiles               input BibTeX files

Options:
  -h, --help            show this help message and exit
  -i, --in-place        modify infile in place
  --drop DROP           drop fields from entries (can be passed multiple times)
  --journal-names {long,short,unchanged}
                        force full or abbreviated journal names (default: unchanged)
  --abbrev-first-names  abbreviate first names in author lists etc. (default: false)
  --sort-entries        sort entries alphabetically by BibTeX key (default: false)
  --sort-fields         sort fields alphabetically (default: false)
  --doi-url-type {unchanged,old,new,short}
                        DOI URL (new: https://doi.org/<DOI>, short: https://doi.org/abcde) (default: new)
  --page-range-separator PAGE_RANGE_SEPARATOR
                        page range separator (int or string, default: unchanged)
  --protect-title-capitalization
                        brace-protect names in titles (e.g., {Newton}; default: false)
  --indent [INDENT]     indentation (int or string; default: 1)
  --align-values        align field values (default: false)
```

#### Dereference DOIs

Given a DOI or a DOI URL, it's often useful to generate a bibliography entry for it. `betterbib doi-to` does just that.

```sh
betterbib doi-to ris 10.1002/andp.19053221004
```

<!--pytest-codeblocks: expected-output-ignore-whitespace-->

```ris
TY  - JOUR
IS  - 10
DO  - 10.1002/andp.19053221004
SP  - 891
EP  - 921
DS  - Crossref
VL  - 322
AU  - Einstein, A.
DA  - 1905/01
UR  - https://doi.org/10.1002/andp.19053221004
SN  - 0003-3804
SN  - 1521-3889
JF  - Annalen der Physik
JO  - Ann. Phys.
PB  - Wiley
TI  - Zur Elektrodynamik bewegter Körper
ER  -
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "betterbib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "bibtex, latex",
    "author": null,
    "author_email": "Nico Schl\u00f6mer <nico.schloemer@gmail.com>",
    "download_url": null,
    "platform": null,
    "description": "<p align=\"center\">\n  <img alt=\"betterbib\" src=\"https://raw.githubusercontent.com/texworld/betterbib/assets/betterbib.svg\" width=\"60%\">\n</p>\n\n[![PyPi Version](https://img.shields.io/pypi/v/betterbib.svg?style=flat-square)](https://pypi.org/project/betterbib)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/betterbib.svg?style=flat-square)](https://pypi.org/pypi/betterbib/)\n[![GitHub stars](https://img.shields.io/github/stars/texworld/betterbib.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/texworld/betterbib)\n\n<!-- [![Downloads](https://pepy.tech/badge/betterbib/month?style=flat-square)](https://pepy.tech/project/betterbib) -->\n<!--[![PyPi downloads](https://img.shields.io/pypi/dm/betterbib.svg?style=flat-square)](https://pypistats.org/packages/betterbib)-->\n\n[![Discord](https://img.shields.io/static/v1?logo=discord&logoColor=white&label=chat&message=on%20discord&color=7289da&style=flat-square)](https://discord.gg/hnTJ5MRX2Y)\n\n> [!NOTE]\n> See [here](https://github.com/texworld) for licensing information.\n\nBibliography files are notoriously hard to work with. Betterbib contains\na number of easy-to-use command-line tools to help.\n\n- [`betterbib convert`](#convert) converts between different bibliography formats, e.g.\n\n  - [BibTeX](https://www.bibtex.org/Format/)\n  - [BibLaTeX](https://ctan.org/pkg/biblatex)\n  - [RIS](<https://en.wikipedia.org/wiki/RIS_(file_format)>)\n  - [CSL-JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)\n\n- [`betterbib sync`](#sync) syncs bibliography data with a number of online sources, e.g.,\n\n  - [Crossref](https://www.crossref.org/)\n  - [DBLP](https://dblp.uni-trier.de/)\n  - [PubMed](https://pubmed.ncbi.nlm.nih.gov/)\n  - [arXiv](https://arxiv.org/)\n  - [Zenodo](https://zenodo.org/)\n\n- [`betterbib format`](#format) formats your bibliography files to your liking.\n  Can also (un)abbreviate author and journal names.\n\n- [`betterbib doi-to`](#dereference-dois) converts a DOI or DOI URL to a bibliography entry.\n\n### Installation\n\nInstall betterbib [from PyPI](https://pypi.org/project/betterbib/) with\n\n<!--pytest.mark.skip-->\n\n```\npip install betterbib\n```\n\n#### Convert\n\n#### Sync\n\nSimply run\n\n<!--pytest.mark.skip-->\n\n```sh\nbetterbib sync in.bib\n```\n\nto sync your bibliography file with online sources. For example, the input\n\n```bibtex\n@article{wiles,\ntitle={Fermat Last Theorem},\ndoi={10.2307/2118559},\n}\n```\n\nis converted to\n\n```bibtex\n@article{wiles,\n  number = {3},\n  doi = {10.2307/2118559},\n  pages = {443},\n  source = {Crossref},\n  volume = {141},\n  author = {Wiles, Andrew},\n  year = {1995},\n  month = may,\n  url = {https://doi.org/10.2307/2118559},\n  issn = {0003-486X},\n  journal = {The Annals of Mathematics},\n  publisher = {JSTOR},\n  title = {Modular Elliptic Curves and Fermat's Last Theorem},\n}\n```\n\nSee `-h`/`--help` for all options.\n\n<!--pytest.mark.skipif(sys.version_info < (3, 11), reason=\"Need Python 3.11+\")-->\n\n```sh\nbetterbib sync -h\n```\n\n<!--pytest-codeblocks: expected-output-ignore-whitespace-->\n\n```\nUsage: betterbib sync [-h] [-i] [-c N] [-s SRC] [-m MINIMUM_SCORE] [-q] [--debug]\n                      [--output-format {bibtex,biblatex,csl-json,ris}]\n                      infiles [infiles ...]\n\nPositional Arguments:\n  infiles               input bibliography files\n\nOptions:\n  -h, --help            show this help message and exit\n  -i, --in-place        modify infile in place\n  -c, --num-concurrent-requests N\n                        number of concurrent HTTPS requests (default: 1)\n  -s, --sources SRC     sources to try (comma-separated, with order; default:\n                        crossref,dblp,pubmed)\n  -m, --minimum-score MINIMUM_SCORE\n                        minimum score to count as a match (default: 0.0)\n  -q, --quiet           don't show progress info (default: show)\n  --debug               some debug output (default: false)\n  --output-format {bibtex,biblatex,csl-json,ris}\n                        force output format (default: same as input)\n```\n\n#### Format\n\nAfter that, you can for example run\n\n```\nbetterbib format in.bib --sort-fields --align-values --journal-names short --abbrev-first-names\n```\n\nto get\n\n```bibtex\n@article{wiles,\n  author    = {Wiles, A.},\n  doi       = {10.2307/2118559},\n  issn      = {0003-486X},\n  journal   = {Ann. Math.},\n  month     = may,\n  number    = {3},\n  pages     = {443},\n  publisher = {JSTOR},\n  source    = {Crossref},\n  title     = {Modular Elliptic Curves and Fermat's Last Theorem},\n  url       = {https://doi.org/10.2307/2118559},\n  volume    = {141},\n  year      = {1995},\n}\n```\n\n```sh\nbetterbib format -h\n```\n\n<!--pytest.mark.skipif(sys.version_info < (3, 11), reason=\"Need Python 3.11+\")-->\n\n```\nUsage: betterbib format [-h] [-i] [--drop DROP] [--journal-names {long,short,unchanged}] [--abbrev-first-names]\n                        [--sort-entries] [--sort-fields] [--doi-url-type {unchanged,old,new,short}]\n                        [--page-range-separator PAGE_RANGE_SEPARATOR] [--protect-title-capitalization]\n                        [--indent [INDENT]] [--align-values]\n                        infiles [infiles ...]\n\nPositional Arguments:\n  infiles               input BibTeX files\n\nOptions:\n  -h, --help            show this help message and exit\n  -i, --in-place        modify infile in place\n  --drop DROP           drop fields from entries (can be passed multiple times)\n  --journal-names {long,short,unchanged}\n                        force full or abbreviated journal names (default: unchanged)\n  --abbrev-first-names  abbreviate first names in author lists etc. (default: false)\n  --sort-entries        sort entries alphabetically by BibTeX key (default: false)\n  --sort-fields         sort fields alphabetically (default: false)\n  --doi-url-type {unchanged,old,new,short}\n                        DOI URL (new: https://doi.org/<DOI>, short: https://doi.org/abcde) (default: new)\n  --page-range-separator PAGE_RANGE_SEPARATOR\n                        page range separator (int or string, default: unchanged)\n  --protect-title-capitalization\n                        brace-protect names in titles (e.g., {Newton}; default: false)\n  --indent [INDENT]     indentation (int or string; default: 1)\n  --align-values        align field values (default: false)\n```\n\n#### Dereference DOIs\n\nGiven a DOI or a DOI URL, it's often useful to generate a bibliography entry for it. `betterbib doi-to` does just that.\n\n```sh\nbetterbib doi-to ris 10.1002/andp.19053221004\n```\n\n<!--pytest-codeblocks: expected-output-ignore-whitespace-->\n\n```ris\nTY  - JOUR\nIS  - 10\nDO  - 10.1002/andp.19053221004\nSP  - 891\nEP  - 921\nDS  - Crossref\nVL  - 322\nAU  - Einstein, A.\nDA  - 1905/01\nUR  - https://doi.org/10.1002/andp.19053221004\nSN  - 0003-3804\nSN  - 1521-3889\nJF  - Annalen der Physik\nJO  - Ann. Phys.\nPB  - Wiley\nTI  - Zur Elektrodynamik bewegter K\u00f6rper\nER  -\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Better bibliography data",
    "version": "7.5.25",
    "project_urls": {
        "Homepage": "https://github.com/texworld/betterbib",
        "Issues": "https://github.com/texworld/betterbib/issues"
    },
    "split_keywords": [
        "bibtex",
        " latex"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3b8e8664e082a6be30f0be8e0cd242e799d7b4f60ca8c53f8373da0216d96928",
                "md5": "128aa1764e3ac2e802a9d3ea67f936f8",
                "sha256": "a623e58ac3751412f8c86e982c86726d3d8aff4e389fc0df6a9ddf35d590a8b4"
            },
            "downloads": -1,
            "filename": "betterbib-7.5.25-cp310-none-any.whl",
            "has_sig": false,
            "md5_digest": "128aa1764e3ac2e802a9d3ea67f936f8",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 2990340,
            "upload_time": "2025-08-03T14:08:06",
            "upload_time_iso_8601": "2025-08-03T14:08:06.498379Z",
            "url": "https://files.pythonhosted.org/packages/3b/8e/8664e082a6be30f0be8e0cd242e799d7b4f60ca8c53f8373da0216d96928/betterbib-7.5.25-cp310-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d9b034861e79281c3a3f98adca787671a2700fbb0c6bd430460d88964749fd59",
                "md5": "8b77e4a29fc7c4fba0ea647a98b02856",
                "sha256": "e05a75c27633fa6f4190f1b1afa17008e7c1e81ac68310e1048d928045f006f4"
            },
            "downloads": -1,
            "filename": "betterbib-7.5.25-cp311-none-any.whl",
            "has_sig": false,
            "md5_digest": "8b77e4a29fc7c4fba0ea647a98b02856",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.10",
            "size": 3077910,
            "upload_time": "2025-08-03T14:08:09",
            "upload_time_iso_8601": "2025-08-03T14:08:09.001921Z",
            "url": "https://files.pythonhosted.org/packages/d9/b0/34861e79281c3a3f98adca787671a2700fbb0c6bd430460d88964749fd59/betterbib-7.5.25-cp311-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9de2d07a7829ecaf7735b652075d6fdb00ddc4e5c741441e3f04d19e578b0ea9",
                "md5": "af152e499205816c50155ccbd0818d9b",
                "sha256": "977be7f38e542c09b7497e1224a4ae6a3221f3f1a8b824be8053221c0b82ec76"
            },
            "downloads": -1,
            "filename": "betterbib-7.5.25-cp312-none-any.whl",
            "has_sig": false,
            "md5_digest": "af152e499205816c50155ccbd0818d9b",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.10",
            "size": 3051344,
            "upload_time": "2025-08-03T14:08:10",
            "upload_time_iso_8601": "2025-08-03T14:08:10.958351Z",
            "url": "https://files.pythonhosted.org/packages/9d/e2/d07a7829ecaf7735b652075d6fdb00ddc4e5c741441e3f04d19e578b0ea9/betterbib-7.5.25-cp312-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cdc53aded2927f77cc2a39612b04b83f030a5645e43b8b7b1505935ebc145f8d",
                "md5": "06448b74aabd658eeca7a05c2d678e42",
                "sha256": "02ad4166d20b6b2b1d3ca3c904033fe3522aeb2b8150a6c56e5cb7fb4e66312e"
            },
            "downloads": -1,
            "filename": "betterbib-7.5.25-cp313-none-any.whl",
            "has_sig": false,
            "md5_digest": "06448b74aabd658eeca7a05c2d678e42",
            "packagetype": "bdist_wheel",
            "python_version": "cp313",
            "requires_python": ">=3.10",
            "size": 3055351,
            "upload_time": "2025-08-03T14:08:12",
            "upload_time_iso_8601": "2025-08-03T14:08:12.505458Z",
            "url": "https://files.pythonhosted.org/packages/cd/c5/3aded2927f77cc2a39612b04b83f030a5645e43b8b7b1505935ebc145f8d/betterbib-7.5.25-cp313-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 14:08:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "texworld",
    "github_project": "betterbib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "betterbib"
}
        
Elapsed time: 1.77039s