# regenbib
*(Re-)generate tidy `.bib` files from online sources*
## Motivation
The gist of `regenbib` is as follows.
Instead of manually maintaining a `references.bib` file with a bunch of entries like this ...
```bibtex
@inproceedings{streamlet,
author = "Chan, Benjamin Y. and Shi, Elaine",
title = "Streamlet: Textbook Streamlined Blockchains",
booktitle = "{AFT}",
pages = "1--11",
publisher = "{ACM}",
year = "2020"
}
```
... you should maintain a `references.yaml` file with corresponding entries like that:
```yaml
entries:
- bibtexid: streamlet
dblpid: conf/aft/ChanS20
```
The tool `regenbib` can then automatically (re-)generate the `references.bib` from the `references.yaml` in a consistent way by retrieving high-quality metadata information from the corresponding online source (in the example above: [dblp](https://dblp.org/)'s entry [conf/aft/ChanS20](https://dblp.org/rec/conf/aft/ChanS20.html?view=bibtex¶m=0)).
The tool `regenbib-import` helps to maintain the `references.yaml` file. Using LaTeX's `.aux` file, it determines entries that are cited but are currently missing from the `references.yaml` file. It then helps the user determine an appropriate online reference through an interactive lookup right from the command line. In the lookup process, an old (possibly messy) `references.bib` file can be used to obtain starting points for the search (eg, title/author in an old `references.bib` entry can be used to lookup the paper on dblp).
See the usage example below for details.
## Installation
If your LaTeX project already has a Python virtual environment, activate it.
Otherwise, setup and activate a virtual environment like this:
```bash
$ python -m venv venv
$ echo "venv/" >> .gitignore
$ source venv/bin/activate
```
Then install `regenbib`:
```bash
$ pip install git+https://github.com/joachimneu/regenbib.git
```
You should now have the commands `regenbib` and `regenbib-import` available to you.
## Example Usage
Suppose we have an old `references.bib` file with this entry (and suppose it does not have a corresponding entry in our `references.yaml` file):
```bibtex
@misc{streamlet,
author = {Chan and Shi},
title = {Streamlet Textbook Streamlined Blockchains}
}
```
We can easily import a corresponding entry to our `references.yaml` file with `regenbib-import`:
```
$ regenbib-import --bib references.bib --aux _build/main.aux --yaml references.yaml
Importing entry: streamlet
-> Current entry: Entry('misc',
fields=[
('title', 'Streamlet Textbook Streamlined Blockchains')],
persons=OrderedCaseInsensitiveDict([('author', [Person('Chan'), Person('Shi')])]))
-> Import method? [0=skip, 1=dblp-free-search, 2=arxiv-manual-id, 3=eprint-manual-id, 4=current-entry, 5=dblp-search-title, 6=dblp-search-authorstitle]: 6
-----> The search returned 2 matches:
-----> (1) Benjamin Y. Chan, Elaine Shi:
Streamlet: Textbook Streamlined Blockchains. AFT 2020
https://doi.org/10.1145/3419614.3423256 https://dblp.org/rec/conf/aft/ChanS20
-----> (2) Benjamin Y. Chan, Elaine Shi:
Streamlet: Textbook Streamlined Blockchains. IACR Cryptol. ePrint Arch. (2020) 2020
https://eprint.iacr.org/2020/088 https://dblp.org/rec/journals/iacr/ChanS20
-----> Intended publication? [0=abort]: 1
```
As you see, `regenbib-import` uses the messy/incomplete information from the old `references.bib` file to help us quickly determine the appropriate dblp entry. This adds the following entry to `references.yaml`:
```yaml
entries:
- bibtexid: streamlet
dblpid: conf/aft/ChanS20
```
We can then re-generate a tidy `references.bib` file based on the `references.yaml` file:
```
$ regenbib --yaml references.yaml --bib references.bib
DblpEntry(bibtexid='streamlet', dblpid='conf/aft/ChanS20')
Entry('inproceedings',
fields=[
('title', 'Streamlet: Textbook Streamlined Blockchains'),
('booktitle', '{AFT}'),
('pages', '1--11'),
('publisher', '{ACM}'),
('year', '2020')],
persons=OrderedCaseInsensitiveDict([('author', [Person('Chan, Benjamin Y.'), Person('Shi, Elaine')])]))
$ cat references.bib
@inproceedings{streamlet,
author = "Chan, Benjamin Y. and Shi, Elaine",
title = "Streamlet: Textbook Streamlined Blockchains",
booktitle = "{AFT}",
pages = "1--11",
publisher = "{ACM}",
year = "2020"
}
```
## Supported Entry Types & Online Metadata Sources
See entry types in `regenbib/store.py`:
* dblp
* arXiv
* IACR ePrint
* Raw `.bib` entry
Raw data
{
"_id": null,
"home_page": "https://github.com/joachimneu/regenbib",
"name": "regenbib",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "latex,bibtex,biblatex",
"author": "Joachim Neu",
"author_email": "jneu@stanford.edu",
"download_url": "https://files.pythonhosted.org/packages/72/fb/784beb0684e10df3550621c9e80b2b4a719e520bb94daca5bd1932e8ec9a/regenbib-0.0.5.tar.gz",
"platform": null,
"description": "# regenbib\n\n*(Re-)generate tidy `.bib` files from online sources*\n\n\n## Motivation\n\nThe gist of `regenbib` is as follows.\nInstead of manually maintaining a `references.bib` file with a bunch of entries like this ...\n```bibtex\n@inproceedings{streamlet,\n author = \"Chan, Benjamin Y. and Shi, Elaine\",\n title = \"Streamlet: Textbook Streamlined Blockchains\",\n booktitle = \"{AFT}\",\n pages = \"1--11\",\n publisher = \"{ACM}\",\n year = \"2020\"\n}\n```\n... you should maintain a `references.yaml` file with corresponding entries like that:\n```yaml\nentries:\n- bibtexid: streamlet\n dblpid: conf/aft/ChanS20\n```\nThe tool `regenbib` can then automatically (re-)generate the `references.bib` from the `references.yaml` in a consistent way by retrieving high-quality metadata information from the corresponding online source (in the example above: [dblp](https://dblp.org/)'s entry [conf/aft/ChanS20](https://dblp.org/rec/conf/aft/ChanS20.html?view=bibtex¶m=0)).\n\nThe tool `regenbib-import` helps to maintain the `references.yaml` file. Using LaTeX's `.aux` file, it determines entries that are cited but are currently missing from the `references.yaml` file. It then helps the user determine an appropriate online reference through an interactive lookup right from the command line. In the lookup process, an old (possibly messy) `references.bib` file can be used to obtain starting points for the search (eg, title/author in an old `references.bib` entry can be used to lookup the paper on dblp).\n\nSee the usage example below for details.\n\n\n## Installation\n\nIf your LaTeX project already has a Python virtual environment, activate it.\nOtherwise, setup and activate a virtual environment like this:\n```bash\n$ python -m venv venv\n$ echo \"venv/\" >> .gitignore\n$ source venv/bin/activate\n```\nThen install `regenbib`:\n```bash\n$ pip install git+https://github.com/joachimneu/regenbib.git\n```\nYou should now have the commands `regenbib` and `regenbib-import` available to you.\n\n\n## Example Usage\n\nSuppose we have an old `references.bib` file with this entry (and suppose it does not have a corresponding entry in our `references.yaml` file):\n```bibtex\n@misc{streamlet,\n author = {Chan and Shi},\n title = {Streamlet Textbook Streamlined Blockchains}\n}\n```\nWe can easily import a corresponding entry to our `references.yaml` file with `regenbib-import`:\n```\n$ regenbib-import --bib references.bib --aux _build/main.aux --yaml references.yaml\nImporting entry: streamlet\n-> Current entry: Entry('misc',\n fields=[\n ('title', 'Streamlet Textbook Streamlined Blockchains')],\n persons=OrderedCaseInsensitiveDict([('author', [Person('Chan'), Person('Shi')])]))\n-> Import method? [0=skip, 1=dblp-free-search, 2=arxiv-manual-id, 3=eprint-manual-id, 4=current-entry, 5=dblp-search-title, 6=dblp-search-authorstitle]: 6\n-----> The search returned 2 matches:\n-----> (1)\tBenjamin Y. Chan, Elaine Shi:\n\t\tStreamlet: Textbook Streamlined Blockchains. AFT 2020\n\t\thttps://doi.org/10.1145/3419614.3423256 https://dblp.org/rec/conf/aft/ChanS20\n-----> (2)\tBenjamin Y. Chan, Elaine Shi:\n\t\tStreamlet: Textbook Streamlined Blockchains. IACR Cryptol. ePrint Arch. (2020) 2020\n\t\thttps://eprint.iacr.org/2020/088 https://dblp.org/rec/journals/iacr/ChanS20\n-----> Intended publication? [0=abort]: 1\n```\nAs you see, `regenbib-import` uses the messy/incomplete information from the old `references.bib` file to help us quickly determine the appropriate dblp entry. This adds the following entry to `references.yaml`:\n```yaml\nentries:\n- bibtexid: streamlet\n dblpid: conf/aft/ChanS20\n```\nWe can then re-generate a tidy `references.bib` file based on the `references.yaml` file:\n```\n$ regenbib --yaml references.yaml --bib references.bib\nDblpEntry(bibtexid='streamlet', dblpid='conf/aft/ChanS20')\nEntry('inproceedings',\n fields=[\n ('title', 'Streamlet: Textbook Streamlined Blockchains'),\n ('booktitle', '{AFT}'),\n ('pages', '1--11'),\n ('publisher', '{ACM}'),\n ('year', '2020')],\n persons=OrderedCaseInsensitiveDict([('author', [Person('Chan, Benjamin Y.'), Person('Shi, Elaine')])]))\n$ cat references.bib\n@inproceedings{streamlet,\n author = \"Chan, Benjamin Y. and Shi, Elaine\",\n title = \"Streamlet: Textbook Streamlined Blockchains\",\n booktitle = \"{AFT}\",\n pages = \"1--11\",\n publisher = \"{ACM}\",\n year = \"2020\"\n}\n```\n\n\n## Supported Entry Types & Online Metadata Sources\n\nSee entry types in `regenbib/store.py`:\n* dblp\n* arXiv\n* IACR ePrint\n* Raw `.bib` entry\n",
"bugtrack_url": null,
"license": "GPL-3.0-only",
"summary": "(Re-)generate tidy .bib files from online sources",
"version": "0.0.5",
"project_urls": {
"Documentation": "https://github.com/joachimneu/regenbib",
"Homepage": "https://github.com/joachimneu/regenbib",
"Repository": "https://github.com/joachimneu/regenbib"
},
"split_keywords": [
"latex",
"bibtex",
"biblatex"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3dbff5807f54cc9a2129c55c8bd4a3772d639011d64e4d41a1a56a3ddaa42186",
"md5": "e0fcf75935a49572022b313354d16f6a",
"sha256": "dbfb23cef15f6179a9d48a1c62a0a89b032842ac28596e2b9da1fd1a87ac72e9"
},
"downloads": -1,
"filename": "regenbib-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e0fcf75935a49572022b313354d16f6a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 19672,
"upload_time": "2023-06-11T22:48:38",
"upload_time_iso_8601": "2023-06-11T22:48:38.775336Z",
"url": "https://files.pythonhosted.org/packages/3d/bf/f5807f54cc9a2129c55c8bd4a3772d639011d64e4d41a1a56a3ddaa42186/regenbib-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "72fb784beb0684e10df3550621c9e80b2b4a719e520bb94daca5bd1932e8ec9a",
"md5": "9a4d5a3f41056a1289fec02dd24d95b9",
"sha256": "d2dac4e3cd025632f80fdc27653dbf6877dcc66e6b9969b7c4d0279adde4190e"
},
"downloads": -1,
"filename": "regenbib-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "9a4d5a3f41056a1289fec02dd24d95b9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 19252,
"upload_time": "2023-06-11T22:48:40",
"upload_time_iso_8601": "2023-06-11T22:48:40.735081Z",
"url": "https://files.pythonhosted.org/packages/72/fb/784beb0684e10df3550621c9e80b2b4a719e520bb94daca5bd1932e8ec9a/regenbib-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-11 22:48:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "joachimneu",
"github_project": "regenbib",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "regenbib"
}