# pybibget
Command line utility to automatically retrieve BibTeX citations from MathSciNet, arXiv, PubMed and doi.org
## Installation
```bash
% pip install pybibget
```
## Usage
### Citation Keys
`pybibget` provides a command line interface to obtain BibTeX entries from citation keys of the form
| Citation key | Format |
|----------------------|-------------------------------|
| MR0026286 | MathSciNet (requires subscription) |
| 1512.03385 | arXiv identifier (new format) |
| hep-th/9711200 | arXiv identifier (old format) |
| PMID:271968 | PubMed |
| 10.1109/CVPR.2016.90 | DOI |
`pybibget key1 key2 ...` prints the BibTeX entries `stdout`:
```console
% pybibget MR0026286 10.1109/TIT.2006.885507 math/0211159 PMID:271968 10.1109/CVPR.2016.90 10.4310/ATMP.1998.v2.n2.a1
@article{MR0026286,
AUTHOR = "Shannon, C. E.",
TITLE = "A mathematical theory of communication",
JOURNAL = "Bell System Tech. J.",
FJOURNAL = "The Bell System Technical Journal",
VOLUME = "27",
YEAR = "1948",
PAGES = "379--423, 623--656",
ISSN = "0005-8580",
MRCLASS = "60.0X",
MRNUMBER = "26286",
MRREVIEWER = "J. L. Doob",
DOI = "10.1002/j.1538-7305.1948.tb01338.x",
URL = "https://doi.org/10.1002/j.1538-7305.1948.tb01338.x"
}
@article{10.1109/TIT.2006.885507,
AUTHOR = "Candes, Emmanuel J. and Tao, Terence",
TITLE = "Near-optimal signal recovery from random projections: universal encoding strategies?",
JOURNAL = "IEEE Trans. Inform. Theory",
FJOURNAL = "Institute of Electrical and Electronics Engineers. Transactions on Information Theory",
VOLUME = "52",
YEAR = "2006",
NUMBER = "12",
PAGES = "5406--5425",
ISSN = "0018-9448",
MRCLASS = "94A12 (41A25 94A13)",
MRNUMBER = "2300700",
MRREVIEWER = "L. L. Campbell",
DOI = "10.1109/TIT.2006.885507",
URL = "https://doi.org/10.1109/TIT.2006.885507"
}
@unpublished{math/0211159,
author = "Perelman, Grisha",
title = "{The} entropy formula for the {Ricci} flow and its geometric applications",
note = "Preprint",
year = "2002",
eprint = "math/0211159",
archiveprefix = "arXiv"
}
@article{PMID:271968,
author = "Sanger, F. and Nicklen, S. and Coulson, A. R.",
doi = "10.1073/pnas.74.12.5463",
url = "https://doi.org/10.1073/pnas.74.12.5463",
year = "1977",
publisher = "Proceedings of the National Academy of Sciences",
volume = "74",
number = "12",
pages = "5463--5467",
title = "{DNA} sequencing with chain-terminating inhibitors",
journal = "Proceedings of the National Academy of Sciences",
PMID = "271968"
}
@inproceedings{10.1109/CVPR.2016.90,
author = "He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian",
doi = "10.1109/cvpr.2016.90",
url = "https://doi.org/10.1109/cvpr.2016.90",
year = "2016",
publisher = "{IEEE}",
title = "{Deep} {Residual} {Learning} for {Image} {Recognition}",
booktitle = "2016 {IEEE} Conference on Computer Vision and Pattern Recognition ({CVPR})"
}
@article{10.4310/ATMP.1998.v2.n2.a1,
AUTHOR = "Maldacena, Juan",
TITLE = "The large {$N$} limit of superconformal field theories and supergravity",
JOURNAL = "Adv. Theor. Math. Phys.",
FJOURNAL = "Advances in Theoretical and Mathematical Physics",
VOLUME = "2",
YEAR = "1998",
NUMBER = "2",
PAGES = "231--252",
ISSN = "1095-0761",
MRCLASS = "81T30 (81T60 83E30)",
MRNUMBER = "1633016",
MRREVIEWER = "Douglas J. Smith",
DOI = "10.4310/ATMP.1998.v2.n2.a1",
URL = "https://doi.org/10.4310/ATMP.1998.v2.n2.a1"
}
```
With the option `-f filename` the result can be *appended* to any given file directly:
```console
% pybibget MR0026286 10.1109/TIT.2006.885507 math/0211159 PMID:271968 10.1109/CVPR.2016.90 10.4310/ATMP.1998.v2.n2.a1 -f bibliography.bib
Succesfully appended 6 BibTeX entries to bibliography.bib
```
### TeX File Parsing
`pybibparse` automatically parses missing citations from the `biber` or `bibtex` log for a given `TeX` file
```console
% pybibparse example
@article{math/0211159,
author = "Perelman, Grisha",
title = "{The} entropy formula for the {Ricci} flow and its geometric applications",
journal = "preprint",
year = "2002",
eprint = "math/0211159",
archiveprefix = "arXiv"
}
@article{PMID:271968,
author = "Sanger, F. and Nicklen, S. and Coulson, A. R.",
doi = "10.1073/pnas.74.12.5463",
url = "https://doi.org/10.1073/pnas.74.12.5463",
year = "1977",
publisher = "Proceedings of the National Academy of Sciences",
volume = "74",
number = "12",
pages = "5463--5467",
title = "{DNA} sequencing with chain-terminating inhibitors",
journal = "Proceedings of the National Academy of Sciences",
PMID = "271968"
}
```
With the option `-w [file_name]` the obtained citations are automatically appended to the `.bib` file. `[file_name]` is optional if the `.bib` file has been specified in the `TeX` file.
```console
% pybibparse example -w
Succesfully appended 2 BibTeX entries to bibliography.bib
```
### Updating existing bibliographies
`pybibupdate [file.bib]` scans an existing `.bib`-file and searches for entries with updated information on [Scopus](https://www.scopus.com/). This functionality requires an API-key which can be obtained from [https://dev.elsevier.com](https://dev.elsevier.com)
## Data Sources
### MathSciNet
Directly accesses [MathSciNet](https://mathscinet.ams.org/mathscinet/index.html) and uses the provided citation unmodified
### DOI
First searches for the DOI on [MathSciNet](https://mathscinet.ams.org/mathscinet/index.html). If successful, uses the MathSciNet strategy, otherwise uses the citation from [doi.org](https://doi.org) with the following modifications:
- Author names and title are converted to TeX form (special characters like `ö` are converted to `"{o}`)
- Capital words in the title are surrounded by `{...}`to ensure capitalization
- Publication month data is removed
### PubMed
Searches for the DOI on [PubMed](https://pubmed.ncbi.nlm.nih.gov), then uses the DOI strategy and appends `pmid = [PMID]` to the resulting citation.
### arXiv
Uses DOI strategy if metadata contains `doi`.
Otherwise creates an `unpublished` bib-entry with `note = "Preprint"` or `note = [Journal Metadata]` (if provided). In any-case appends `eprint = [arXiv identifier]` to the citation.
Raw data
{
"_id": null,
"home_page": "https://github.com/wirhabenzeit/pybibget",
"name": "pybibget",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "BibTeX,MathSciNet,PubMed,DOI,arXiv,bibliography,command-line,citation",
"author": "Dominik Schr\u00f6der",
"author_email": "dschroeder@ethz.ch",
"download_url": "https://files.pythonhosted.org/packages/6d/04/f3da9638e153fad45aae5b89437282d5988be3fb3da6f4d854299b8a0f9d/pybibget-0.1.0.tar.gz",
"platform": null,
"description": "# pybibget\n\nCommand line utility to automatically retrieve BibTeX citations from MathSciNet, arXiv, PubMed and doi.org\n\n## Installation\n\n```bash\n% pip install pybibget\n```\n\n## Usage\n\n### Citation Keys\n\n`pybibget` provides a command line interface to obtain BibTeX entries from citation keys of the form\n\n| Citation key | Format |\n|----------------------|-------------------------------|\n| MR0026286 | MathSciNet (requires subscription) |\n| 1512.03385 | arXiv identifier (new format) |\n| hep-th/9711200 | arXiv identifier (old format) |\n| PMID:271968 | PubMed |\n| 10.1109/CVPR.2016.90 | DOI |\n\n`pybibget key1 key2 ...` prints the BibTeX entries `stdout`:\n\n```console\n% pybibget MR0026286 10.1109/TIT.2006.885507 math/0211159 PMID:271968 10.1109/CVPR.2016.90 10.4310/ATMP.1998.v2.n2.a1\n\n@article{MR0026286,\n AUTHOR = \"Shannon, C. E.\",\n TITLE = \"A mathematical theory of communication\",\n JOURNAL = \"Bell System Tech. J.\",\n FJOURNAL = \"The Bell System Technical Journal\",\n VOLUME = \"27\",\n YEAR = \"1948\",\n PAGES = \"379--423, 623--656\",\n ISSN = \"0005-8580\",\n MRCLASS = \"60.0X\",\n MRNUMBER = \"26286\",\n MRREVIEWER = \"J. L. Doob\",\n DOI = \"10.1002/j.1538-7305.1948.tb01338.x\",\n URL = \"https://doi.org/10.1002/j.1538-7305.1948.tb01338.x\"\n}\n\n@article{10.1109/TIT.2006.885507,\n AUTHOR = \"Candes, Emmanuel J. and Tao, Terence\",\n TITLE = \"Near-optimal signal recovery from random projections: universal encoding strategies?\",\n JOURNAL = \"IEEE Trans. Inform. Theory\",\n FJOURNAL = \"Institute of Electrical and Electronics Engineers. Transactions on Information Theory\",\n VOLUME = \"52\",\n YEAR = \"2006\",\n NUMBER = \"12\",\n PAGES = \"5406--5425\",\n ISSN = \"0018-9448\",\n MRCLASS = \"94A12 (41A25 94A13)\",\n MRNUMBER = \"2300700\",\n MRREVIEWER = \"L. L. Campbell\",\n DOI = \"10.1109/TIT.2006.885507\",\n URL = \"https://doi.org/10.1109/TIT.2006.885507\"\n}\n\n@unpublished{math/0211159,\n author = \"Perelman, Grisha\",\n title = \"{The} entropy formula for the {Ricci} flow and its geometric applications\",\n note = \"Preprint\",\n year = \"2002\",\n eprint = \"math/0211159\",\n archiveprefix = \"arXiv\"\n}\n\n@article{PMID:271968,\n author = \"Sanger, F. and Nicklen, S. and Coulson, A. R.\",\n doi = \"10.1073/pnas.74.12.5463\",\n url = \"https://doi.org/10.1073/pnas.74.12.5463\",\n year = \"1977\",\n publisher = \"Proceedings of the National Academy of Sciences\",\n volume = \"74\",\n number = \"12\",\n pages = \"5463--5467\",\n title = \"{DNA} sequencing with chain-terminating inhibitors\",\n journal = \"Proceedings of the National Academy of Sciences\",\n PMID = \"271968\"\n}\n\n@inproceedings{10.1109/CVPR.2016.90,\n author = \"He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian\",\n doi = \"10.1109/cvpr.2016.90\",\n url = \"https://doi.org/10.1109/cvpr.2016.90\",\n year = \"2016\",\n publisher = \"{IEEE}\",\n title = \"{Deep} {Residual} {Learning} for {Image} {Recognition}\",\n booktitle = \"2016 {IEEE} Conference on Computer Vision and Pattern Recognition ({CVPR})\"\n}\n\n@article{10.4310/ATMP.1998.v2.n2.a1,\n AUTHOR = \"Maldacena, Juan\",\n TITLE = \"The large {$N$} limit of superconformal field theories and supergravity\",\n JOURNAL = \"Adv. Theor. Math. Phys.\",\n FJOURNAL = \"Advances in Theoretical and Mathematical Physics\",\n VOLUME = \"2\",\n YEAR = \"1998\",\n NUMBER = \"2\",\n PAGES = \"231--252\",\n ISSN = \"1095-0761\",\n MRCLASS = \"81T30 (81T60 83E30)\",\n MRNUMBER = \"1633016\",\n MRREVIEWER = \"Douglas J. Smith\",\n DOI = \"10.4310/ATMP.1998.v2.n2.a1\",\n URL = \"https://doi.org/10.4310/ATMP.1998.v2.n2.a1\"\n}\n```\n\nWith the option `-f filename` the result can be *appended* to any given file directly:\n\n```console\n% pybibget MR0026286 10.1109/TIT.2006.885507 math/0211159 PMID:271968 10.1109/CVPR.2016.90 10.4310/ATMP.1998.v2.n2.a1 -f bibliography.bib\nSuccesfully appended 6 BibTeX entries to bibliography.bib\n```\n\n### TeX File Parsing\n\n`pybibparse` automatically parses missing citations from the `biber` or `bibtex` log for a given `TeX` file\n\n```console\n% pybibparse example \n\n@article{math/0211159,\n author = \"Perelman, Grisha\",\n title = \"{The} entropy formula for the {Ricci} flow and its geometric applications\",\n journal = \"preprint\",\n year = \"2002\",\n eprint = \"math/0211159\",\n archiveprefix = \"arXiv\"\n}\n\n@article{PMID:271968,\n author = \"Sanger, F. and Nicklen, S. and Coulson, A. R.\",\n doi = \"10.1073/pnas.74.12.5463\",\n url = \"https://doi.org/10.1073/pnas.74.12.5463\",\n year = \"1977\",\n publisher = \"Proceedings of the National Academy of Sciences\",\n volume = \"74\",\n number = \"12\",\n pages = \"5463--5467\",\n title = \"{DNA} sequencing with chain-terminating inhibitors\",\n journal = \"Proceedings of the National Academy of Sciences\",\n PMID = \"271968\"\n}\n```\n\nWith the option `-w [file_name]` the obtained citations are automatically appended to the `.bib` file. `[file_name]` is optional if the `.bib` file has been specified in the `TeX` file.\n\n```console\n% pybibparse example -w\nSuccesfully appended 2 BibTeX entries to bibliography.bib\n```\n\n### Updating existing bibliographies\n\n`pybibupdate [file.bib]` scans an existing `.bib`-file and searches for entries with updated information on [Scopus](https://www.scopus.com/). This functionality requires an API-key which can be obtained from [https://dev.elsevier.com](https://dev.elsevier.com)\n\n## Data Sources\n\n### MathSciNet\n\nDirectly accesses [MathSciNet](https://mathscinet.ams.org/mathscinet/index.html) and uses the provided citation unmodified\n\n### DOI\n\nFirst searches for the DOI on [MathSciNet](https://mathscinet.ams.org/mathscinet/index.html). If successful, uses the MathSciNet strategy, otherwise uses the citation from [doi.org](https://doi.org) with the following modifications:\n\n- Author names and title are converted to TeX form (special characters like `\u00f6` are converted to `\"{o}`)\n- Capital words in the title are surrounded by `{...}`to ensure capitalization\n- Publication month data is removed\n\n### PubMed\n\nSearches for the DOI on [PubMed](https://pubmed.ncbi.nlm.nih.gov), then uses the DOI strategy and appends `pmid = [PMID]` to the resulting citation.\n\n### arXiv\n\nUses DOI strategy if metadata contains `doi`. \nOtherwise creates an `unpublished` bib-entry with `note = \"Preprint\"` or `note = [Journal Metadata]` (if provided). In any-case appends `eprint = [arXiv identifier]` to the citation.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Command line utility to automatically retrieve BibTeX citations from MathSciNet, arXiv, PubMed and doi.org",
"version": "0.1.0",
"split_keywords": [
"bibtex",
"mathscinet",
"pubmed",
"doi",
"arxiv",
"bibliography",
"command-line",
"citation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c06bdeca198ef9ce8b069cd27553433e21b7dd1bff3a30543ab2f627e827153a",
"md5": "9d208e747acfa434623c24a94ed6071f",
"sha256": "e4378006b4a5e1537f53c36af3c336eded3741a44c1a1eec7757388791abf09b"
},
"downloads": -1,
"filename": "pybibget-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9d208e747acfa434623c24a94ed6071f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 12645,
"upload_time": "2023-01-10T12:45:14",
"upload_time_iso_8601": "2023-01-10T12:45:14.692008Z",
"url": "https://files.pythonhosted.org/packages/c0/6b/deca198ef9ce8b069cd27553433e21b7dd1bff3a30543ab2f627e827153a/pybibget-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6d04f3da9638e153fad45aae5b89437282d5988be3fb3da6f4d854299b8a0f9d",
"md5": "294fe2a8a0c979b736fac7343bceb1ad",
"sha256": "33a08872d4ce567ee420f9aca07426625db041a5337de97baf2c3fdde6d08ad8"
},
"downloads": -1,
"filename": "pybibget-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "294fe2a8a0c979b736fac7343bceb1ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14338,
"upload_time": "2023-01-10T12:45:16",
"upload_time_iso_8601": "2023-01-10T12:45:16.129214Z",
"url": "https://files.pythonhosted.org/packages/6d/04/f3da9638e153fad45aae5b89437282d5988be3fb3da6f4d854299b8a0f9d/pybibget-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-10 12:45:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "wirhabenzeit",
"github_project": "pybibget",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
">=",
"2.28.1"
]
]
},
{
"name": "pybtex",
"specs": [
[
">=",
"0.24.0"
]
]
},
{
"name": "lxml",
"specs": [
[
">=",
"4.9.2"
]
]
},
{
"name": "pylatexenc",
"specs": [
[
">=",
"1.3"
]
]
},
{
"name": "aiolimiter",
"specs": [
[
">=",
"1.0.0"
]
]
},
{
"name": "appdirs",
"specs": [
[
">=",
"1.0.0"
]
]
},
{
"name": "httpx",
"specs": [
[
">=",
"0.21.0"
]
]
}
],
"lcname": "pybibget"
}