Confusables is a Python package designed for analyzing and matching words that appear similar but use different Unicode characters. It leverages the official Unicode confusable characters list to detect homoglyphs, which can be useful for applications like identifying malicious fake website names, normalizing text data, or bypassing profanity filters. The library is currently at version 1.2.0 and receives updates as needed, particularly for Unicode character set changes.
pip install confusablesVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the core functionalities: checking if two strings are confusable, generating a regular expression to match confusable variations of a string, and normalizing a string to a list of possible "normal forms" with ASCII priority.
Remove the `match_subword` argument from calls to `confusable_regex()`. The function's behavior now automatically includes subword matching.
Review applications relying on specific confusable character sets. The updated Unicode data may result in more comprehensive (or different) matches.
Be aware that confusable matching is not an exact science. Regularly test critical use cases with new library versions if strict, consistent matching across versions is required.
Install the package using pip: `pip install confusables`
Consult the `confusables` library documentation (PyPI or GitHub) to ensure you are using the correct function names and available attributes. For instance, if you intended to check if two strings are confusable, use `confusables.is_confusable(string1, string2)`.
Ensure you are passing the correct number and type of arguments as specified by the function's signature. For `is_confusable`, provide exactly two strings: `from confusables import is_confusable; is_confusable('hello', 'h3ll0')`.