Skip to main content

A Python library for collating eScriptorium documents.

Project description

eScriptorium Collate

PyPI - Version PyPI - Python Version


Table of Contents

Installation

Requirements

  • Python 3
  • Java Runtime Environment (< 15)

Vendored Binaries

This package uses the CollateX collatex-tools-1.7.1.jar Java Archive. The Jar file is bundled with the package, so there is no need to download it separately. However, you will need to ensure that your system has a working Java Runtime Environment version < 15 accessible under JAVA_HOME.

Virtual Environment

Before installing the package, it is a good idea to create a Python virtual environment:

pip install virtualenv
virtualenv -p python3 venv
source venv/bin/activate

Alternatively:

python3 -m venv venv
source venv/bin/activate

Click here for a more detailed guide to Python virtual environments.

Install

Once you have activated the virtual environment, install the package:

pip install escriptorium-collate

Quick Start

Instantiate the eScriptorium Connector

import os

from dotenv import load_dotenv
from escriptorium_connector import EscriptoriumConnector

load_dotenv(override=True)
url = str(os.getenv("ESCRIPTORIUM_URL"))
username = str(os.getenv("ESCRIPTORIUM_USERNAME"))
password = str(os.getenv("ESCRIPTORIUM_PASSWORD"))
api_key = str(os.getenv("ESCRIPTORIUM_API_KEY"))

if api_key:
    escr = EscriptoriumConnector(url, api_key=api_key)
else:
    escr = EscriptoriumConnector(url, username, password)

escr = EscriptoriumConnector(url, username, password)

The .env file should look like this:

ESCRIPTORIUM_URL=your_escriptorium_url
ESCRIPTORIUM_API_KEY=your_escriptorium_api_key
ESCRIPTORIUM_USERNAME=your_escriptorium_username
ESCRIPTORIUM_PASSWORD=your_escriptorium_password

Instantiate the Witness that will be Collated

from escriptorium_collate.collate import Witness

witnesses = [
    Witness(
        pk=1,
        siglum="A",
        diplomatic_transcription_name="diplomatic",
        normalized_transcription_name="normalized",
    ),
    Witness(
        pk=2,
        siglum="B",
        diplomatic_transcription_name="diplomatic",
        normalized_transcription_name="normalized",
    ),
    Witness(
        pk=3,
        siglum="C",
        diplomatic_transcription_name="diplomatic",
        normalized_transcription_name="normalized",
    ),
]

Instantiate the Arguments to be Passed to CollateX

from escriptorium_collate.collate import CollatexArgs

collatex_args = CollatexArgs()

Run the Collation

collatex_output = collate(escr=escr, witnesses=witnesses, collatex_args=collatex_args)

License

escriptorium-collate is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

escriptorium_collate-0.1.4.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

escriptorium_collate-0.1.4-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file escriptorium_collate-0.1.4.tar.gz.

File metadata

  • Download URL: escriptorium_collate-0.1.4.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for escriptorium_collate-0.1.4.tar.gz
Algorithm Hash digest
SHA256 291acf38e38e3efd1ab77a8c9a625cf49171ec72de17ae30a699fbe87c4f6a51
MD5 183a4988b771418c8457ada23ba4b9d6
BLAKE2b-256 82d4aaaa08720a14ff92a8a3312d3e3b52574c2b00e852dd84b94025ea8b896c

See more details on using hashes here.

File details

Details for the file escriptorium_collate-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for escriptorium_collate-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 23179c8f643707748f14009775b18610631f5d45bd9e9f19550d06e75efc4175
MD5 1ab1e9ec0ee7e5e647fc4eee177a87cd
BLAKE2b-256 c8a0243e221bd29fd28ed32d7c36e58a38fe932400b1da0b73629b16b785c613

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page