Write SGA TEI as SharedCanvas
Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
unbind
.gitignore
.travis.yml
LICENSE
README.md
ch.py
deploy.sh
requirements.txt
setup.py
test.py
unbind_all.sh

README.md

unbind

Build Status

unbind is a Python utility for generating a Shared Canvas manifest from Shelley-Godwin TEI. It's also a work in progress...

Setup

git clone https://github.com/umd-mith/unbind.git
cd unbind
pip install -r requirements.txt
python setup.py install

or if you'd rather install it so you can work on it:

python setup.py develop

Command Line

When you install you will get a command line program unbind which you can pass the path to a TEI file and the URI you'd like to use for the manifest, and it will write a Shared Canvas document as JSON-LD to stdout:

% unbind /path/to/tei.xml http://example.com/manifest.jsonld > manifest.jsonld

As a Library

To create a manifest programatically you need to give Manifest the path to a TEI XML file, and also the URI where the manifest is going to be published:

from unbind.shared_canvas import Manifest

m = Manifest("/path/to/a/tei/file.xml", "http://example.com/manifest.jsonld")
print m.jsonld()

Test

To run the tests you will need a copy of the Shelley-Godwin TEI data:

git clone https://github.com/umd-mith/sga.git

then:

python setup.py test