# bibpy v1.0.1
[![Build status](https://travis-ci.org/MisanthropicBit/bibpy.svg?branch=master)](https://travis-ci.org/github/MisanthropicBit/bibpy)
[![Read the Docs](https://img.shields.io/readthedocs/bibpy)](https://readthedocs.org/projects/bibpy/)
[![Coverage Status](https://coveralls.io/repos/github/MisanthropicBit/bibpy/badge.svg?branch=master)](https://coveralls.io/github/MisanthropicBit/bibpy?branch=master)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/MisanthropicBit/bibpy/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/bibpy)](https://pypi.org/project/bibpy/)
[![PyPI wheel](https://img.shields.io/pypi/wheel/bibpy)](https://pypi.org/project/bibpy/)
[![Python version](https://img.shields.io/pypi/pyversions/bibpy.svg)](https://pypi.org/project/bibpy/)
Python library for parsing bib(la)tex files and manipulating entries.
* [Automatic conversion](https://github.com/MisanthropicBit/bibpy/tree/master/examples/field_conversion.py) of entry fields to and from appropriate Python types
* [Requirements-checking for entry fields](https://github.com/MisanthropicBit/bibpy/tree/master/examples/requirements_check.py)
* [String variable expansion and unexpansion](https://github.com/MisanthropicBit/bibpy/tree/master/examples/string_expansion.py)
* [Crossreference and xdata inheritance](https://github.com/MisanthropicBit/bibpy/tree/master/examples/crossref_expansion.py)
* Accompanying [tools](https://bibpy.readthedocs.io/en/latest/tutorial.html#bibpy-tools)
# Installation
```bash
pip install bibpy
```
<a name="quickstart"></a>
# Quickstart
```python
>>> import bibpy
>>> result = bibpy.read_file('references.bib') # Read a bib file
>>> entries = result.entries
>>> print len(entries)
6
>>> print entries[0].author
'D. J. Power'
>>> print entries[0].bibkey
'2006_power'
>>> print entries[0].bibtype
'online'
>>> print entries[0].valid('bibtex')
True # Entry is a valid bibtex entry
>>> print entries[0].valid('biblatex')
False # But is not a valid biblatex entry (missing field 'date' or 'year')
>>> print entries[0].aliases('bibtex')
[]
>>> print entries[0].aliases('biblatex')
['electronic', 'www']
>>> bibpy.write_file('references.bib', entries)
```
See the [`examples`](https://github.com/MisanthropicBit/bibpy/tree/master/examples)
folder for more usage examples or read the
[tutorial](https://bibpy.readthedocs.io/en/latest/tutorial.html).
## Tools
`bibpy` also comes with three tools that are installed as runnable scripts.
* `bibformat`: Clean up, format and align references
* `bibgrep` : Find and filter references using a simple query language
* `bibstats` : Display statistics about bib files
All three tools are described in more detail in the
[tutorial](https://bibpy.readthedocs.io/en/latest/tutorial.html#bibpy-tools).
Raw data
{
"_id": null,
"home_page": "https://bibpy.readthedocs.io/en/latest/",
"name": "bibpy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "",
"keywords": "bibpy,bibtex,biblatex,parser",
"author": "Alexander Asp Bock",
"author_email": "albo.developer@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ce/39/40e1fbc97049d741a5c24cf63d606fd028857b951cb92b42845afc7ff283/bibpy-1.0.1.tar.gz",
"platform": "All",
"description": "# bibpy v1.0.1\n\n[![Build status](https://travis-ci.org/MisanthropicBit/bibpy.svg?branch=master)](https://travis-ci.org/github/MisanthropicBit/bibpy)\n[![Read the Docs](https://img.shields.io/readthedocs/bibpy)](https://readthedocs.org/projects/bibpy/)\n[![Coverage Status](https://coveralls.io/repos/github/MisanthropicBit/bibpy/badge.svg?branch=master)](https://coveralls.io/github/MisanthropicBit/bibpy?branch=master)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/MisanthropicBit/bibpy/blob/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/bibpy)](https://pypi.org/project/bibpy/)\n[![PyPI wheel](https://img.shields.io/pypi/wheel/bibpy)](https://pypi.org/project/bibpy/)\n[![Python version](https://img.shields.io/pypi/pyversions/bibpy.svg)](https://pypi.org/project/bibpy/)\n\nPython library for parsing bib(la)tex files and manipulating entries.\n\n* [Automatic conversion](https://github.com/MisanthropicBit/bibpy/tree/master/examples/field_conversion.py) of entry fields to and from appropriate Python types\n* [Requirements-checking for entry fields](https://github.com/MisanthropicBit/bibpy/tree/master/examples/requirements_check.py)\n* [String variable expansion and unexpansion](https://github.com/MisanthropicBit/bibpy/tree/master/examples/string_expansion.py)\n* [Crossreference and xdata inheritance](https://github.com/MisanthropicBit/bibpy/tree/master/examples/crossref_expansion.py)\n* Accompanying [tools](https://bibpy.readthedocs.io/en/latest/tutorial.html#bibpy-tools)\n\n# Installation\n\n```bash\npip install bibpy\n```\n\n<a name=\"quickstart\"></a>\n# Quickstart\n\n```python\n>>> import bibpy\n>>> result = bibpy.read_file('references.bib') # Read a bib file\n>>> entries = result.entries\n>>> print len(entries)\n6\n>>> print entries[0].author\n'D. J. Power'\n>>> print entries[0].bibkey\n'2006_power'\n>>> print entries[0].bibtype\n'online'\n>>> print entries[0].valid('bibtex')\nTrue # Entry is a valid bibtex entry\n>>> print entries[0].valid('biblatex')\nFalse # But is not a valid biblatex entry (missing field 'date' or 'year')\n>>> print entries[0].aliases('bibtex')\n[]\n>>> print entries[0].aliases('biblatex')\n['electronic', 'www']\n>>> bibpy.write_file('references.bib', entries)\n```\n\nSee the [`examples`](https://github.com/MisanthropicBit/bibpy/tree/master/examples)\nfolder for more usage examples or read the\n[tutorial](https://bibpy.readthedocs.io/en/latest/tutorial.html).\n\n## Tools\n\n`bibpy` also comes with three tools that are installed as runnable scripts.\n\n* `bibformat`: Clean up, format and align references\n* `bibgrep` : Find and filter references using a simple query language\n* `bibstats` : Display statistics about bib files\n\nAll three tools are described in more detail in the\n[tutorial](https://bibpy.readthedocs.io/en/latest/tutorial.html#bibpy-tools).\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "Bib(la)tex parsing and useful tools",
"version": "1.0.1",
"split_keywords": [
"bibpy",
"bibtex",
"biblatex",
"parser"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0fa876fcce28a4af04dbffaf1b729b7da15a07ea81a57b8db11683921dfe89e6",
"md5": "73c582cc044d1573fab046466a81e73e",
"sha256": "08ae3c98cdd2198941e2395af0d47af3c5904ace8b92a4dad72b62f8b81740d6"
},
"downloads": -1,
"filename": "bibpy-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "73c582cc044d1573fab046466a81e73e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 49067,
"upload_time": "2023-01-14T13:25:52",
"upload_time_iso_8601": "2023-01-14T13:25:52.007486Z",
"url": "https://files.pythonhosted.org/packages/0f/a8/76fcce28a4af04dbffaf1b729b7da15a07ea81a57b8db11683921dfe89e6/bibpy-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ce3940e1fbc97049d741a5c24cf63d606fd028857b951cb92b42845afc7ff283",
"md5": "de1358c0f06a09a050bf585731c6268b",
"sha256": "e24dfc5baf1b826d8d105ba652daf27f2b05cb431cde717482ad1fbf5593c39d"
},
"downloads": -1,
"filename": "bibpy-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "de1358c0f06a09a050bf585731c6268b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 156019,
"upload_time": "2023-01-14T13:25:54",
"upload_time_iso_8601": "2023-01-14T13:25:54.075463Z",
"url": "https://files.pythonhosted.org/packages/ce/39/40e1fbc97049d741a5c24cf63d606fd028857b951cb92b42845afc7ff283/bibpy-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-14 13:25:54",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "bibpy"
}