Translate Modern English text into playful Early Modern English.
Project description
ShakesPy
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
yousoYou know meandI know youdo 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:
- spaCy dependency parsing for grammatical rules
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf528bc2171ad324dd82c3e82a3dd6ff12bcb6af6fa3a2691d936c418943183b
|
|
| MD5 |
57bb718f9be41322871bf47c2c4fa0de
|
|
| BLAKE2b-256 |
ce30ae06573bc03e24e81f8efc7c7403487e4f96ae1f0db1cfd366cc632027b3
|
File details
Details for the file theworker02_shakespy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: theworker02_shakespy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.34.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
600e7b68852f164a4a4a211d76893a3c65f4d417b5da5a1c8f714f50af2fc908
|
|
| MD5 |
086f58bc5908164f668d979b7b60ade1
|
|
| BLAKE2b-256 |
9b31c723c3e5aa7ffb64510d1aeccf56ad8c76bbe1d4a726a0391ec753082de8
|