Converting American English to British English - a tool to automatically convert American English spelling to British English spelling in your text and code files.
- Github repository: https://github.com/i-dot-ai/uwotm8/
- Documentation https://i-dot-ai.github.io/uwotm8/
pip install uwotm8
Convert a single file:
uwotm8 example.txt
Convert only comments and docstrings in Python files:
uwotm8 --comments-only my_script.py
Read from stdin and write to stdout:
echo "I love the color gray." | uwotm8
# Output: "I love the colour grey."
Use in Python code:
from uwotm8 import convert_american_to_british_spelling
en_gb_str = convert_american_to_british_spelling("Our American neighbors' dialog can be a bit off-color.")
print(en_gb_str)
# Output: "Our American neighbours' dialogue can be a bit off-colour."
- Converts common American English spellings to British English
- Preserves words in special contexts (code blocks, URLs, hyphenated terms)
- Maintains an ignore list of technical terms that shouldn't be converted
- Preserves original capitalization patterns
- Supports Python file mode to convert only comments and docstrings, leaving code unchanged
For full documentation, examples, and advanced usage, please visit the documentation site.
Repository initiated with fpgmaas/cookiecutter-poetry.