semvec/pypi-packages huggingface dataset:
biop 0.1.dev3
Build a cache of files in the folder tree for efficiency and emergency purposes
License: BSD 3-Clause License
Keywords: cache folder

`biop` -- JSON format for text annotation
=========================================

BioP JSON format can be used to share text documents and annotations.

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

Development of ``biop`` happens on GitHub: https://github.com/yfpeng/pengyifan-biop


Getting started
---------------

Installing ``biop`` (with `conda`)

.. code:: bash

    $ git clone https://github.com/yfpeng/pengyifan-biop.git
    $ cd pengyifan-biop
    $ conda env create -f environment2.7.yml
    $ source activate biop
    $ python setup.py

Encoding the BioC collection object ``collection``:

.. code:: python

    import bioj
    # Serialize ``PDocument`` to a BioP formatted ``str``.
    bioc.dumps(document)

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

Decoding the BioP JSON file:

.. code:: python

    import biop

    # Deserialize ``fp`` to a BioP document object.
    with open(filename, 'r') as fp:
        biop.load(fp)

Validation
----------

To validate the dataset format, run

.. code:: bash

    jsonschema -i tests/foo.json biop_schema.json


Contributing
------------

Please read `CONTRIBUTING </CONTRIBUTING.md>`_ for details on our code of conduct, and the process for submitting pull requests to us.

Developers
----------

-  Yifan Peng (yifan.peng@nih.gov)

License
-------

see `LICENSE.txt </LICENSE.txt>`_.

Acknowledgments
---------------

We are grateful to the folowing projects: `BioC <http://bioc.sourceforge.net/>`_ and `Brat <http://brat.nlplab.org/>`_.