Name | bioc JSON |
Version |
2.1
JSON |
| download |
home_page | |
Summary | bioc - Processing BioC, Brat, and PubTator with Python. |
upload_time | 2023-08-15 22:34:59 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
license | |
keywords |
bioc
brat
pubtator
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
# bioc - Processing BioC, Brat, and PubTator with Python
[![Build
status](https://github.com/bionlplab/bioc/actions/workflows/pytest.yml/badge.svg)](https://github.com/bionlplab/bioc/)
[![Latest version on
PyPI](https://img.shields.io/pypi/v/bioc.svg)](https://pypi.python.org/pypi/bioc)
[![Downloads](https://img.shields.io/pypi/dm/bioc.svg)](https://pypi.python.org/pypi/bioc)
[![License](https://img.shields.io/pypi/l/bioc.svg)](https://opensource.org/licenses/MIT)
[![codecov](https://codecov.io/gh/bionlplab/bioc/branch/master/graph/badge.svg?token=3kEUctqxTx)](https://codecov.io/gh/bionlplab/bioc)
[BioC XML / JSON format](http://bioc.sourceforge.net/) can be used to
share text documents and annotations.
[Brat standoff format](https://brat.nlplab.org/standoff.html) is created by the brat annotation tool to store
annotations on disk in a standoff format. annotations are stored separately from the annotated document text, which is
never modified by the tool.
[PubTator format](https://www.ncbi.nlm.nih.gov/research/pubtator/) is created by the PutTator Central system.
`bioc` exposes an API familiar to users of the standard library
`marshal` and `pickle` modules.
Development of `bioc` happens on GitHub:
<https://github.com/bionlplab/bioc>
## Getting started
Installing `bioc`
```shell
$ pip install bioc
```
### BioC
Encoding the BioC collection object `collection`:
```python
from bioc import biocxml
# Serialize ``collection`` as a BioC formatted stream to ``fp``.
with open(filename, 'w') as fp:
biocxml.dump(collection, fp)
```
Decoding the BioC XML file:
```python
from bioc import biocxml
# Deserialize ``fp`` to a BioC collection object.
with open(filename, 'r') as fp:
collection = biocxml.load(fp)
```
### Brat
Encoding the Brat document
```python
from bioc import brat
# Serialize ``doc`` as a brat formatted stream to ``text_fp`` and ``ann_fp``.
with open(annpath, 'w') as ann_fp, open(txtpath, 'w') as text_fp:
brat.dump(doc, text_fp, ann_fp)
```
Decoding the Brat document:
```python
from bioc import brat
# Deserialize two streams (text and ann) to a Brat document object.
with open(annpath) as ann_fp, open(txtpath) as text_fp:
doc = brat.load(text_fp, ann_fp)
```
### PubTator
Encoding the PubTator document object `doc`:
```python
from bioc import pubtator
# Serialize ``collection`` as a BioC formatted stream to ``fp``.
with open(filename, 'w') as fp:
pubtator.dump([doc], fp)
```
Decoding the PubTator file
```python
from bioc import pubtator
# Deserialize ``fp`` to a PubTator object.
with open(filename, 'r') as fp:
docs = pubtator.load(fp)
```
## Documentation
You will find complete documentation at our [Read the Docs
site](https://bioc.readthedocs.io/en/latest/index.html).
## Contributing
You can find information about contributing to bioc at our [Contribution
page](https://bioc.readthedocs.io/en/latest/contribute.html).
## Reference
If you use bioc in your research, please cite the following paper:
- Comeau DC, Doğan RI, Ciccarese P, Cohen KB, Krallinger M, Leitner F, Lu Z, Peng Y, Rinaldi F, Torii M,
Valencia V, Verspoor K, Wiegers TC, Wu CH, Wilbur WJ. BioC: a minimalist approach to interoperability
for biomedical text processing. Database (Oxford). 2013;2013:bat064. doi: 10.1093/database/bat064.
Print 2013. PMID: 24048470; PMCID: PMC3889917
## Acknowledgment
This work is supported by the National Library of Medicine under Award No.
4R00LM013001.
## License
Copyright BioNLP Lab at Weill Cornell Medicine, 2023.
Distributed under the terms of the [MIT](https://github.com/bionlplab/bioc/blob/master/LICENSE) license,
bioc is free and open source software.
Raw data
{
"_id": null,
"home_page": "",
"name": "bioc",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "bioc,brat,pubtator",
"author": "",
"author_email": "Yifan Peng <yip4002@med.cornell.edu>",
"download_url": "https://files.pythonhosted.org/packages/44/9b/90086bbbffcf4aaa267a71e94f92eab1cfe4142198708129b8495e16c73f/bioc-2.1.tar.gz",
"platform": null,
"description": "# bioc - Processing BioC, Brat, and PubTator with Python\n\n[![Build\nstatus](https://github.com/bionlplab/bioc/actions/workflows/pytest.yml/badge.svg)](https://github.com/bionlplab/bioc/)\n[![Latest version on\nPyPI](https://img.shields.io/pypi/v/bioc.svg)](https://pypi.python.org/pypi/bioc)\n[![Downloads](https://img.shields.io/pypi/dm/bioc.svg)](https://pypi.python.org/pypi/bioc)\n[![License](https://img.shields.io/pypi/l/bioc.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/gh/bionlplab/bioc/branch/master/graph/badge.svg?token=3kEUctqxTx)](https://codecov.io/gh/bionlplab/bioc)\n\n[BioC XML / JSON format](http://bioc.sourceforge.net/) can be used to\nshare text documents and annotations.\n\n[Brat standoff format](https://brat.nlplab.org/standoff.html) is created by the brat annotation tool to store\nannotations on disk in a standoff format. annotations are stored separately from the annotated document text, which is\nnever modified by the tool.\n\n[PubTator format](https://www.ncbi.nlm.nih.gov/research/pubtator/) is created by the PutTator Central system.\n\n`bioc` exposes an API familiar to users of the standard library\n`marshal` and `pickle` modules.\n\nDevelopment of `bioc` happens on GitHub:\n<https://github.com/bionlplab/bioc>\n\n## Getting started\n\nInstalling `bioc`\n\n```shell\n$ pip install bioc\n```\n\n### BioC\n\nEncoding the BioC collection object `collection`:\n\n```python\nfrom bioc import biocxml\n# Serialize ``collection`` as a BioC formatted stream to ``fp``.\nwith open(filename, 'w') as fp:\n biocxml.dump(collection, fp)\n```\n\nDecoding the BioC XML file:\n\n```python\nfrom bioc import biocxml\n# Deserialize ``fp`` to a BioC collection object.\nwith open(filename, 'r') as fp:\n collection = biocxml.load(fp)\n```\n\n### Brat\n\nEncoding the Brat document\n\n```python\nfrom bioc import brat\n# Serialize ``doc`` as a brat formatted stream to ``text_fp`` and ``ann_fp``.\nwith open(annpath, 'w') as ann_fp, open(txtpath, 'w') as text_fp:\n brat.dump(doc, text_fp, ann_fp)\n```\n\nDecoding the Brat document:\n\n```python\nfrom bioc import brat\n# Deserialize two streams (text and ann) to a Brat document object.\nwith open(annpath) as ann_fp, open(txtpath) as text_fp:\n doc = brat.load(text_fp, ann_fp)\n```\n\n### PubTator\n\nEncoding the PubTator document object `doc`:\n\n```python\nfrom bioc import pubtator\n# Serialize ``collection`` as a BioC formatted stream to ``fp``.\nwith open(filename, 'w') as fp:\n pubtator.dump([doc], fp)\n```\n\nDecoding the PubTator file\n\n```python\nfrom bioc import pubtator\n# Deserialize ``fp`` to a PubTator object.\nwith open(filename, 'r') as fp:\n docs = pubtator.load(fp)\n```\n\n## Documentation\n\nYou will find complete documentation at our [Read the Docs\nsite](https://bioc.readthedocs.io/en/latest/index.html).\n\n## Contributing\n\nYou can find information about contributing to bioc at our [Contribution\npage](https://bioc.readthedocs.io/en/latest/contribute.html).\n\n## Reference\n\nIf you use bioc in your research, please cite the following paper:\n\n - Comeau DC, Do\u011fan RI, Ciccarese P, Cohen KB, Krallinger M, Leitner F, Lu Z, Peng Y, Rinaldi F, Torii M, \n Valencia V, Verspoor K, Wiegers TC, Wu CH, Wilbur WJ. BioC: a minimalist approach to interoperability \n for biomedical text processing. Database (Oxford). 2013;2013:bat064. doi: 10.1093/database/bat064. \n Print 2013. PMID: 24048470; PMCID: PMC3889917\n \n## Acknowledgment\n\nThis work is supported by the National Library of Medicine under Award No.\n4R00LM013001.\n \n## License\n\nCopyright BioNLP Lab at Weill Cornell Medicine, 2023.\n\nDistributed under the terms of the [MIT](https://github.com/bionlplab/bioc/blob/master/LICENSE) license, \nbioc is free and open source software.\n",
"bugtrack_url": null,
"license": "",
"summary": "bioc - Processing BioC, Brat, and PubTator with Python.",
"version": "2.1",
"project_urls": {
"Homepage": "https://github.com/bionlplab/bioc"
},
"split_keywords": [
"bioc",
"brat",
"pubtator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4b05ae6dcab59673e2d498c645903ded6c5d76f7d44920386285feb96c517b3a",
"md5": "3501ce456f97fc246119dfeafa6437ff",
"sha256": "f1730d26821330f9f625058841612d6cfb616efb906fc682297fe04dd5d9398a"
},
"downloads": -1,
"filename": "bioc-2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3501ce456f97fc246119dfeafa6437ff",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 33419,
"upload_time": "2023-08-15T22:34:56",
"upload_time_iso_8601": "2023-08-15T22:34:56.022921Z",
"url": "https://files.pythonhosted.org/packages/4b/05/ae6dcab59673e2d498c645903ded6c5d76f7d44920386285feb96c517b3a/bioc-2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "449b90086bbbffcf4aaa267a71e94f92eab1cfe4142198708129b8495e16c73f",
"md5": "8b58999cb37add4df045bbd5d449342b",
"sha256": "7d9248198bdae291b0ebb218de2dc653c96d32a7eac2fa0ef4ed0c74ce45aaaa"
},
"downloads": -1,
"filename": "bioc-2.1.tar.gz",
"has_sig": false,
"md5_digest": "8b58999cb37add4df045bbd5d449342b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 27924,
"upload_time": "2023-08-15T22:34:59",
"upload_time_iso_8601": "2023-08-15T22:34:59.047104Z",
"url": "https://files.pythonhosted.org/packages/44/9b/90086bbbffcf4aaa267a71e94f92eab1cfe4142198708129b8495e16c73f/bioc-2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-15 22:34:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bionlplab",
"github_project": "bioc",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "bioc"
}