Package: confusable-homoglyphs
confusable_homoglyphs[doc]This project has been adopted fromthe original confusable_homoglyphs
by Victor Felder.a homoglyph is one of two or more graphemes, characters, or glyphs with
shapes that appear identical or very similarwikipedia:HomoglyphUnicode homoglyphs can be a nuisance on the web. Your most popular
client, AlaskaJazz, might be upset to be impersonated by a trickster who
deliberately chose the username ΑlaskaJazz.AlaskaJazzis single script: only Latin characters.ΑlaskaJazzis mixed-script: the first character is a greek
letter.You might also want to avoid people being tricked into entering their
password onwww.micros﻿оft.comorwww.faϲebook.cominstead ofwww.microsoft.comorwww.facebook.com.Here is a
utilityto play
with theseconfusable homoglyphs.Not all mixed-script strings have to be ruled out though, you could only
exclude mixed-script strings containing characters that might be
confused with a character from some unicode blocks of your choosing.Alloandρττare fine: single script.AlloΓis fine when our preferred script alias is ‘latin’: mixed
script, butΓis not confusable.Alloρis dangerous: mixed script andρcould be confused withp.This library is compatible with Python 3.API documentationIs the data up to date?Yep.The unicode blocks aliases and names for each character are extracted
fromthis fileprovided by the unicode consortium.The matrix of which character can be confused with which other
characters is built usingthis
fileprovided by the unicode consortium.This data is stored in two JSON files:categories.jsonandconfusables.json. If you delete them, they will both be recreated by
downloading and parsing the two abovementioned files and stored as JSON
files again.History1.0.0Initial release.2.0.0allowed_categoriesrenamed toallowed_aliases2.0.1Fix a TypeError:https://github.com/vhf/confusable_homoglyphs/pull/23.0.0Courtesy of Ryan P Kilby, viahttps://github.com/vhf/confusable_homoglyphs/pull/6:Changed file paths to be relative to theconfusable_homoglyphspackage directory instead of the user’s current working directory.Data files are now distributed with the packaging.Fixes tests so that they use the installed distribution instead of the
local files. (Originally, the data files were erroneously showing up
during testing, despite not being included in the distribution).Moves the data file generation into a simple CLI. This way, users have
a method for controlling when the data files are updated.Since the data files are now included in the distribution, the CLI is
made optional. Its dependencies can be installed with theclibundle, eg.pip install confusable_homoglyphs[cli].3.1.0Update unicode data3.1.1Update unicode data (via ftp)3.2.0Drop support for Python 3.3Fix #11: work as expected when char not found in datafiles3.3.0Drop support for Python 2Drop support for Python < 3.7, add support for Python up to 3.12Allow using data files from a custom location set with the
CONFUSABLE_DATA environment variable.Fix the return value of confusables.is_dangerous() to the documented
API of a boolean value. It used to return either False or the list
output of confusable.is_confusable().Added a check command for command line use.3.3.1Update unicode data