Skip to main content

Translate Modern English text into playful Early Modern English.

Project description

ShakesPy

Python Build Tests License

ShakesPy is a lightweight Python library and CLI for translating Modern English into a playful Early Modern English style inspired by Shakespeare and the King James Bible.

ShakesPy combines spaCy-powered grammatical analysis with phrase and vocabulary remapping to produce translations that feel more intentionally Shakespearean than a simple word-for-word replacer.

Features

  • spaCy-powered grammatical rewrites for subject/object pronouns
  • Smarter second-person verb conjugation such as you are -> thou art
  • Auxiliary handling for forms such as you will find -> thou wilt find
  • Expanded lexical and phrase replacements such as good morning -> good morrow
  • Simple command-line interface

Why ShakesPy

  • Distinguishes subject and object you so You know me and I know you do not translate the same way
  • Uses dependency parsing to conjugate second-person verbs more naturally
  • Supports both programmatic use and a small CLI for quick translations
  • Ships as a single Flit-packaged Python library with a focused API

Installation

Install from source for local development:

pip install -e .
python -m spacy download en_core_web_sm

Or install the project with Flit:

flit install --symlink
python -m spacy download en_core_web_sm

Usage

from shakespy import translate

print(translate("You are making a mistake."))
print(translate("You will find your answer before night."))
print(translate("Good morning, please wait."))
shakespy "You are making a mistake."
python -m shakespy.cli "Hello! I want to help you."
python -m shakespy.cli "Good morning, please wait."

Example outputs:

  • You are making a mistake. -> Thou art making a mistake.
  • You will find your answer before night. -> Thou wilt find thine answer ere night.
  • I want to help you. -> I desire to help thee.
  • Good morning, please wait. -> Good morrow, prithee bide.

Development

pip install -e .[dev]
python -m spacy download en_core_web_sm
python -m pytest
flit build

Notes

The translator uses a two-tier pipeline:

  1. spaCy dependency parsing for grammatical rules
  2. Regex-based phrase and lexical replacements for broader stylistic coverage

License

This project is licensed under the Apache License 2.0. See 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

theworker02_shakespy-1.0.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

theworker02_shakespy-1.0.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file theworker02_shakespy-1.0.0.tar.gz.

File metadata

  • Download URL: theworker02_shakespy-1.0.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for theworker02_shakespy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cf528bc2171ad324dd82c3e82a3dd6ff12bcb6af6fa3a2691d936c418943183b
MD5 57bb718f9be41322871bf47c2c4fa0de
BLAKE2b-256 ce30ae06573bc03e24e81f8efc7c7403487e4f96ae1f0db1cfd366cc632027b3

See more details on using hashes here.

File details

Details for the file theworker02_shakespy-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for theworker02_shakespy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 600e7b68852f164a4a4a211d76893a3c65f4d417b5da5a1c8f714f50af2fc908
MD5 086f58bc5908164f668d979b7b60ade1
BLAKE2b-256 9b31c723c3e5aa7ffb64510d1aeccf56ad8c76bbe1d4a726a0391ec753082de8

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