skillfed

bioc

bioc - Processing BioC, Brat, and PubTator with Python.

bioc v2.1 165.7K downloads/30d#10,520 on PyPI34
Permissive license Abandoned released

What it is and what it does

bioc is a Python library for serializing and deserializing three biomedical text annotation formats: BioC (XML and JSON), Brat standoff, and PubTator. It exposes a familiar API modeled on Python's standard library marshal and pickle modules, making it straightforward to load annotation files into Python objects and dump them back to disk.

The package is designed for biomedical NLP workflows where text documents and their annotations need to be exchanged or processed. It depends on lxml for XML parsing, jsonlines for JSON line handling, intervaltree for interval operations, tqdm for progress bars, and docopt for command-line argument parsing. The library has been stable since its 2016 release but is no longer actively maintained.

Use it for:

  • Load BioC XML annotation files from biomedical corpora for downstream NLP processing or analysis
  • Convert between Brat standoff format and BioC format for annotation tool interoperability
  • Parse PubTator Central output to extract biomedical entity and relation annotations from literature
  • Serialize processed annotation objects back to BioC or Brat format for sharing with collaborators
  • Build reproducible biomedical text mining pipelines that depend on standardized annotation formats

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Reads and writes biomedical text annotation formats—BioC XML/JSON, Brat standoff, and PubTator—with a marshal/pickle-like API.

Yes, if you work with BioC, Brat, or PubTator formats in a stable biomedical NLP pipeline. The package is mature and has no known vulnerabilities, but it is abandoned and will not receive updates. Install only if you are confident the format specifications and your dependencies will remain compatible, or if you plan to maintain a fork yourself.

Install

bioc on PyPI

pip

pip install bioc

uv

uv add bioc

poetry

poetry add bioc

Installing bioc

Before you install

Low install friction with five lightweight runtime dependencies. Package is abandoned as of 2023-08-21 with no commits since; last release was 2023-08-15, over 1095 days ago. Suitable for stable use cases but expect no maintenance or bug fixes.

License in practice

MIT license (permissive); you may use, modify, and distribute bioc freely in commercial and private projects with minimal restrictions.

Quickstart

pip install bioc

from bioc import biocxml
with open('file.xml', 'r') as fp:
    collection = biocxml.load(fp)

Verify before relying

  • Whether the package works correctly with current versions of lxml, jsonlines, intervaltree, tqdm, and docopt
  • Whether PubTator and Brat format specifications have changed since the last release in 2023

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 5 — lxml, jsonlines, intervaltree, tqdm, docopt
Maintenance abandoned — 1,095 days since the last release
Last repo commit
First released
Downloads 165,686/month — #10,520 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: bioc-2.1-py3-none-any.whl

Keywords: bioc, brat, pubtator

Development Status :: 1 - PlanningIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Application FrameworksTopic :: Text Processing :: Markup :: XML

Tags

biomedical text annotation parsingbioc xml json formatbrat standoff formatpubtator format processingnlp annotation serializationbiomedical document markup
biomedical-nlpannotation-formatsabandoned

More Application Frameworks packages