betterbib


Namebetterbib JSON
Version 7.1.4 PyPI version JSON
download
home_page
SummaryBetter bibliography data
upload_time2024-03-11 15:20:26
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords latex bibtex
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)

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
```

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

#### 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] [-m MINIMUM_SCORE] [-q] [--debug] 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: 5)
  -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)
```

#### 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": "",
    "name": "betterbib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "latex,bibtex",
    "author": "",
    "author_email": "Nico Schl\u00f6mer <nico.schloemer@gmail.com>",
    "download_url": "",
    "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\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. Can also\n  (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\nSee [here](https://github.com/texworld) for licensing information.\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] [-m MINIMUM_SCORE] [-q] [--debug] 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: 5)\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```\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": "",
    "summary": "Better bibliography data",
    "version": "7.1.4",
    "project_urls": {
        "Homepage": "https://github.com/texworld/betterbib",
        "Issues": "https://github.com/texworld/betterbib/issues"
    },
    "split_keywords": [
        "latex",
        "bibtex"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c7a7f692f9262f8681cb751b770851d1461ef723ad6843d2dc74116791b88b3d",
                "md5": "bf6188b2c3d35e7fb56a31b0cf4d6d04",
                "sha256": "bde974b0fef82b667bdc205be684f03c41dfcad7744833aa7cffd67dc884ca32"
            },
            "downloads": -1,
            "filename": "betterbib-7.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bf6188b2c3d35e7fb56a31b0cf4d6d04",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 2773983,
            "upload_time": "2024-03-11T15:20:26",
            "upload_time_iso_8601": "2024-03-11T15:20:26.082015Z",
            "url": "https://files.pythonhosted.org/packages/c7/a7/f692f9262f8681cb751b770851d1461ef723ad6843d2dc74116791b88b3d/betterbib-7.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-11 15:20:26",
    "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: 0.24589s