Library for CTS APIs and CapiTainS guidelines in Python


License
MPL-2.0
Install
pip install MyCapytain==2.0.8

Documentation

https://travis-ci.org/Capitains/MyCapytain.svg?branch=master https://coveralls.io/repos/Capitains/MyCapytain/badge.svg?branch=master https://readthedocs.org/projects/mycapytain/badge/?version=latest https://api.codacy.com/project/badge/grade/8e63e69a94274422865e4f275dbf08ea License: MPL 2.0

MyCapytain is a python library which provides a large set of methods to interact with Text Services API such as the Canonical Text Services, the Distributed Text Services. It also provides a programming interface to exploit local textual resources developed according to the Capitains Guidelines.

Simple Example of what it does

The following code and example is badly displayed at the moment on Github. We recommend you to go to http://mycapytain.readthedocs.org

On Leipzig DH Chair's Canonical Text Services API, we can find the Epigrammata of Martial. This texts are identified by the identifier "urn:cts:latinLit:phi1294.phi002.perseus-lat2". We want to have some information about this text so we are gonna ask the API to give its metadata to us :

This query will return the following information :

<class 'MyCapytain.resources.collections.cts.Text'> ['book', 'poem', 'line']

And we will get

Hesterna factum narratur, Postume, cena

If you want to play more with this, like having a list of what can be found in book three, you could go and do

Which would be equal to :

['3.1', '3.2', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', ...]

Now, it's your time to work with the resource ! See the CapiTainS Classes page on ReadTheDocs to have a general introduction to MyCapytain objects !

Installation and Requirements

The best way to install MyCapytain is to use pip. MyCapytain tries to support Python over 3.4.

The work needed for supporting Python 2.7 is mostly done, however, since 2.0.0, we are giving up on ensuring that MyCapytain will be compatible with Python < 3 while accepting PR which would help doing so.

pip install MyCapytain

If you prefer to use setup.py, you should clone and use the following

git clone https://github.com/Capitains/MyCapytain.git
cd MyCapytain
python setup.py install