Skip to content

About

Client library for the DICES database of speeches in Greek and Roman epic

Resources

Stars

6 stars

Watchers

2 watching

Forks

Latest commit

 

History

128 Commits

Folders and files

Repository files navigation

Python client library for working with the DICES database of Greek and Latin epic speeches.

DICES (Digital Initiative for Classics: Epic Speeches) records who says what to whom in Greek and Latin epic poetry. The database is at db.dices.mta.ca; this package talks to its API (https://db.dices.mta.ca/api/) and returns speeches, characters, works and authors as Python objects.

Installation

The base package gives you the API client and tools for retrieving the text of speeches via CTS.

If you also want to run NLP pipelines (tokenization, POS tagging, etc.) on speech texts, install the SpaCy extras.

pip install git+https://github.com/cwf2/dices-client # base
pip install "dices-client[spacy]@git+https://github.com/cwf2/dices-client" # SpaCy NLP

Quick start

from dicesapi import DicesAPI

api = DicesAPI()

# every speech by Achilles in the Iliad
speeches = api.getSpeeches(work_title="Iliad", spkr_name="Achilles")
print(len(speeches))

for speech in speeches.list[:3]:
    print(speech, [str(a) for a in speech.addr])

getSpeeches() accepts any search field the API supports as a keyword argument. To see them all:

api.printSearchFields("speeches")

The same pattern works for getWorks(), getAuthors(), getCharacters(), getInstances() and getClusters(). Downloading the whole database takes about a minute; for repeated use, filter on the server where you can.

Related resources

License

Released under the MIT License.

About

Client library for the DICES database of speeches in Greek and Roman epic

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages