Skip to main content

Fixes typos in text using regular expressions, based on RegExTypoFix from Wikipedia

Project description

https://badge.fury.io/py/topy.svg Travis CI

Topy (anagram of “typo”) is a Python script to fix typos in text, using rulesets developed by the RegExTypoFix project from Wikipedia. The English ruleset is included with Topy and is used by default. Other rulesets can be manually downloaded.

Topy works with Python 2.7 and 3.5-3.7.

The easiest way to install it is using pip:

pip install topy

Usage:

Usage: topy [options] FILES/DIRS...

Options:
  -h, --help            show this help message and exit
  -q, --quiet           silence information messages
  -a, --apply           overwrite files in place
  -r FILE, --rules=FILE
                        specify custom ruleset file to use
  -d RULE, --disable=RULE
                        disable rules by name

Resources

Changelog

0.3.0 (2020-06-02)

Note: This will be the last release to support Python 2.7.

  • Updated bundled ruleset (thanks to Oscar Caballero)

  • Added –disable option to disable individual rules (thanks to Oscar Caballero)

  • Fixed behavior when replacement string contains $ symbol (thanks to Oscar Caballero)

  • Prefer the faster lxml parser when it is installed. lxml is now an optional dependency (thanks to Oscar Caballero)

  • Added Python 3.7 support, deprecated Python 3.3 and 3.4.

0.2.2 (2016-12-16)

  • Update bundled ruleset

  • Officially add Python 3.6 support

0.2.1 (2016-07-15)

  • Update bundled ruleset

  • Update regex dependency version to avoid regex issue #216

  • Officially add Python 3.5 support

0.2.0 (2015-09-09)

  • Several fixes with Unicode on Python 2

  • Can safely deal with filenames that are invalid Unicode

  • Update bundled ruleset

  • Fix a few warnings from used libraries

0.1.0 (2014-08-24)

  • Initial public release

Contributing

Code style:

  • In general follow the Python PEP-8 coding style, except line length can go up to 120 chars.

  • Strings that have meaning for humans use double quotes ("), otherwise single quotes ('). When in doubt, don’t worry about it.

  • Code should be compatible with both Python 2 and 3, preferably without version-specific conditionals.

Run the test suite using python setup.py test.

Submit your changes as pull requests on GitHub.

License

The Topy software is licensed under the MIT license (see LICENSE.txt)

The bundled retf.txt file, copied from Wikipedia AutoWikiBrowser/Typos by Wikipedia contributors is licensed under CC-BY-SA. See the page on Wikipedia for authorship information.

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

topy-0.3.0.tar.gz (137.6 kB view details)

Uploaded Source

File details

Details for the file topy-0.3.0.tar.gz.

File metadata

  • Download URL: topy-0.3.0.tar.gz
  • Upload date:
  • Size: 137.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for topy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b9407fbadd8f49f1dcec005a09742ceb5896a66b41b754a14bb481326eccefff
MD5 d8dc46ae3d8914f648d717907b1de38b
BLAKE2b-256 4d05109aa4ef39e11cc714ad959dd7aebbb476eef1fc22c8b1303e2142a39586

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page