Poio API is a free and open source Python library to access and analyse data from language documentation in your linguistic analysis workflow. It converts file formats like Elan’s EAF, Toolbox files, Typecraft XML and others into annotation graphs as defined in ISO 24612. Those graphs, for which we use an implementation called “Graph Annotation Framework” (GrAF), allow unified access to linguistic data from a wide range of sources.
Think of GrAF as an assembly language for linguistic annotation, then Poio API is a library to map from and to higher-level languages.
Poio API is developed as a part of the curation project of the F-AG 3 within CLARIN-D.
This block of code loads a Elan EAF file as annotation graph and writes the data as html table into a file:
import poioapi.data # Create an empty annotation graph
ag = poioapi.annotationgraph.AnnotationGraph(None)
# Load the data from EAF file
# Set the structure type for hierarchical/interlinear output
ag.structure_type_handler = poioapi.data.DataStructureType(ag.tier_hierarchies) # Output as html
f = codecs.open("example.html", "w", "utf-8")
The Poio API source code is distributed under the Apache 2.0 License.
You need to install the following Python packages:
It is recommended to install Poio API from PyPI, you can install via easy_install:
$ easy_install poio-api
To install Poio API from the downloaded package you need to unpack the file and start "setup.py" on the command line. Change to the directory into which you downloaded the package and unpack it:
$ unzip poio-api-x.y.z.zip $ cd poio-api-x.y.z
Then, to install the package locally into your python repository (you may need to have root privileges):
$ python setup.py install
Visit our documentation website.
The graf-python source code is hosted on Github.