Skip to main content

BioC data structures and encoder/decoder for Python

Project description

BioC XML format can be used to share text documents and annotations.

bioc exposes an API familiar to users of the standard library marshal and pickle modules.

Development of bioc happens on GitHub: https://github.com/yfpeng/pengyifan-pybioc

Getting started

Installing bioc

$ pip install --pre bioc

Encoding the BioC collection object `collection’:

import bioc
# Serialize ``collection`` to a BioC formatted ``str``.
bioc.dumps(collection)

# Serialize ``collection`` as a BioC formatted stream to ``fp``.
with open(filename, 'w') as fp
    bioc.dump(collection, fp)

Compact encoding:

import bioc
bioc.dumps(collection, pretty_print=False)

Decoding the BioC XML file:

import json
# Deserialize ``s`` to a BioC collection object.
collection = json.loads(s)
# Deserialize ``fp`` to a BioC collection object.
with open(filename, 'r') as fp:
    bioc.load(fp)

Requirements

lxml

Developers

Acknowledgment

Webpage

The official BioC webpage is available with all up-to-date instructions, code, and corpora in the BioC format, and other research on, based on and related to BioC.

Reference

  • Comeau,D.C., Doğan,R.I., Ciccarese,P., Cohen,K.B., Krallinger,M., Leitner,F., Lu,Z., Peng,Y., Rinaldi,F., Torii,M., Valencia,V., Verspoor,K., Wiegers,T.C., Wu,C.H., Wilbur,W.J. (2013) BioC: A minimalist approach to interoperability for biomedical text processing. Database: The Journal of Biological Databases and Curation.

  • Peng,Y., Tudor,C., Torii,M., Wu,C.H., Vijay-Shanker,K. (2014) iSimp in BioC standard format: Enhancing the interoperability of a sentence simplification system. Database: The Journal of Biological Databases and Curation.

  • Marques,M., Rinaldi,F. (2012) PyBioC: a python implementation of the BioC core. In Proceedings of BioCreative IV workshop.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bioc-1.0.dev22.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

bioc-1.0.dev22-py2.7.egg (2.5 kB view details)

Uploaded Egg

File details

Details for the file bioc-1.0.dev22.tar.gz.

File metadata

  • Download URL: bioc-1.0.dev22.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bioc-1.0.dev22.tar.gz
Algorithm Hash digest
SHA256 74ec68abda518d6d8b1614d2ab4e96b69fc54de3369576015008a4172b8949d8
MD5 532c9670b907c8bc253dd36e32ebc555
BLAKE2b-256 bc4b9a97f16faeddc10cf879dabba5be5ed4dd48146715632386eaeeffebbead

See more details on using hashes here.

File details

Details for the file bioc-1.0.dev22-py2.7.egg.

File metadata

  • Download URL: bioc-1.0.dev22-py2.7.egg
  • Upload date:
  • Size: 2.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bioc-1.0.dev22-py2.7.egg
Algorithm Hash digest
SHA256 fe71d20d8fba2d5bf3d6107cc12184fdc99e39ac2060ec5ea4f4de7f14f2be5f
MD5 612149b9e9de309d86f88c38d581fb1b
BLAKE2b-256 114d0e357d942757065c619824fc3026f75143bf5b0296519e79f05bfa97dd3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page