Skip to main content

Tools for Managing the Manuscripts

Project description

PyPI - Version testing badge coverage badge docs badge black badge doi badge

Tools for Managing the Manuscripts. Derived from Peter Montoro’s thesis regarding of Chrysostom’s Homilies on Romans.

Installation

To install, use the following command:

pip install msstools

To install the latest development version, use:

pip install -U git+https://github.com/rbturnbull/msstools.git

Command Line Usage

See available commands with:

msstools --help

split-images

Description: Split image files into left and right parts (typically recto and verso pages), with optional right-to-left direction, overlap, and flexible naming.

Arguments:

  • prefix: Path to the output prefix for split images.

  • images: One or more image files to be split.

  • --rtl: (Optional) Split images in right-to-left direction.

  • --overlap: (Optional) Overlap percentage between split images (default: 10).

  • --skip: (Optional) Number of images to skip before splitting.

  • --recto: (Optional) Recto folio anchor in the form FILENAME=FOLIO. Can be used multiple times.

  • --force: (Optional) Overwrite existing output files if they already exist.

Example (sequential numbering):

msstools split-images output/page img001.jpg img002.jpg --rtl --overlap 20

This will create the following files:

output/page-0.jpg
output/page-1.jpg
output/page-2.jpg
output/page-3.jpg

Skipped images are copied into the same output sequence without a folio reference. For example, --skip 3 starts with page-0.jpg, page-1.jpg, and page-2.jpg.

Example (folio references):

msstools split-images output/page img001.jpg img002.jpg img003.jpg --recto img002.jpg=49

This will create the following files:

output/page-0.jpg
output/page-1.jpg
output/page-2.jpg
output/page-3-49r.jpg
output/page-4-49v.jpg
output/page-5-50r.jpg

Everything before the first --recto anchor has no folio reference. After an anchor, folio references continue automatically until the next anchor.

remove-accents

Description: Remove accents from a UTF-8 text file and save the cleaned version to a new file.

Arguments:

  • input_file: Path to the input text file.

  • output_file: Path to the output text file with accents removed.

Example:

msstools remove-accents input.txt output.txt

number-sentences

Description: Number <S> sentence tags within <P> paragraph blocks in an XML or structured text file.

Arguments:

  • input_file: Path to the input text file.

  • output_file: Path to the output file with numbered sentence tags.

Example:

msstools number-sentences H1.txt H1_numbered.txt

count-greek-chars

Description: Count the number of Greek characters in a set of homily text files and generate a plot showing the results. Optionally display or save the plot.

Arguments:

  • filename_prefix: Prefix used to construct the filenames of the homily files.

  • --start-homily: (Optional) First homily number to compare (default: 0).

  • --end-homily: (Optional) Last homily number to compare (default: 32).

  • --warning-stdev: (Optional) Standard deviation threshold for highlighting outliers (default: 1.8).

  • --output: (Optional) Path to save the plot as an image.

  • --show: (Optional) Show the plot in a window (default: False unless there is no output).

Example:

msstools count-greek-chars Jerusalem_PB_Saba_20_copy/Saba20_H --output Saba20-counts.png

compare-counts

Description: Compare the Greek character counts between two sets of homily transcriptions and optionally generate a plot showing where the comparison text has significantly more characters than the base.

Arguments:

  • base_prefix: Prefix for the base homily files.

  • comparison_prefix: Prefix for the comparison homily files.

  • --output-svg: (Optional) Path to save the resulting plot as an SVG.

  • --start-homily: (Optional) First homily number to compare (default: 0).

  • --end-homily: (Optional) Last homily number to compare (default: 32).

  • --threshold: (Optional) Character difference threshold that triggers a warning (default: 50).

Example:

msstools compare-counts Migne_H Saba20_H --threshold 40

csv-to-tei

Description: Convert a CSV file of variant readings into TEI XML format. Optionally limit readings and add dates from a separate file.

Arguments:

  • input_csv: Path to the input CSV file containing readings.

  • output_xml: Path to the TEI XML output file.

  • --dates: (Optional) Path to a file containing date information.

  • --max-readings: (Optional) Maximum number of readings to process at each variation unit (default: 0 = no limit).

Example:

msstools csv-to-tei readings.csv output-tei.xml --dates dates.csv --max-readings 10

Credits

To if you use this software in your research, please cite the following article:

Montoro, Peter, and Robert Turnbull. “Tools, Tricks, and Techniques: Managing the Manuscripts of Chrysostom’s Homilies on Romans.” Comparative Oriental Manuscript Studies Bulletin 11 (2025): 265–88. DOI: 10.25592/uhhfdm.18366

@article{msstools,
    author = {Montoro, Peter and Turnbull, Robert},
    title = {{Tools, Tricks, and Techniques: Managing the Manuscripts of Chrysostom’s Homilies on Romans}},
    year = {2025},
    volume = {11},
    pages = {265-288},
    journal = {Comparative Oriental Manuscript Studies Bulletin},
    doi = {10.25592/uhhfdm.18366}
}

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

msstools-0.2.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

msstools-0.2.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file msstools-0.2.0.tar.gz.

File metadata

  • Download URL: msstools-0.2.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.1 Darwin/25.4.0

File hashes

Hashes for msstools-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0a34ecd218b6e60060b94a2553269884866935074c820374a02f027a58d3d5da
MD5 8627662059f2574fe5c7db636ab4efb6
BLAKE2b-256 70836f1717b0de38e4ec4a58a61e87ba07cd1d184a95463ac707a21772a8ba38

See more details on using hashes here.

File details

Details for the file msstools-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: msstools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.1 Darwin/25.4.0

File hashes

Hashes for msstools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02c6212cbb71d618dc02df5ec41b9c5f554150fa2c09b0bd56dfea1c5cf3c4aa
MD5 146b329a3faf41b34dcd6d94e876670e
BLAKE2b-256 931e403712a9f53dfe724d41ce3ae2c397bdb3ab8fbad48d7ae085c0b730074f

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