Skip to content

i-dot-ai/uwotm8

Repository files navigation

uwotm8

Release Build status codecov Commit activity License

Converting American English to British English - a tool to automatically convert American English spelling to British English spelling in your text and code files.

Installation

pip install uwotm8

Quick Start

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."

Features

  • 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.

About

Converting American English to British English

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •