Skip to main content

confusable_homoglyphs [doc]

This project has been adopted from the original confusable_homoglyphs by Victor Felder.

Build Status Version on PyPi Documentation Status

a homoglyph is one of two or more graphemes, characters, or glyphs with shapes that appear identical or very similar wikipedia:Homoglyph

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

  • AlaskaJazz is single script: only Latin characters.

  • ΑlaskaJazz is mixed-script: the first character is a greek letter.

You might also want to avoid people being tricked into entering their password on www.microsоft.com or www.faϲebook.com instead of www.microsoft.com or www.facebook.com. Here is a utility to play with these confusable 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.

  • Allo and ρττ 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 with p.

This library is compatible with Python 3.

API documentation

Is the data up to date?

Yep.

The unicode blocks aliases and names for each character are extracted from this file provided by the unicode consortium.

The matrix of which character can be confused with which other characters is built using this file provided by the unicode consortium.

This data is stored in two JSON files: categories.json and confusables.json. If you delete them, they will both be recreated by downloading and parsing the two abovementioned files and stored as JSON files again.

History

1.0.0

Initial release.

2.0.0

  • allowed_categories renamed to allowed_aliases

2.0.1

3.0.0

Courtesy of Ryan P Kilby, via https://github.com/vhf/confusable_homoglyphs/pull/6 :

  • Changed file paths to be relative to the confusable_homoglyphs package 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 the cli bundle, eg. pip install confusable_homoglyphs[cli].

3.1.0

  • Update unicode data

3.1.1

  • Update unicode data (via ftp)

3.2.0

  • Drop support for Python 3.3

  • Fix #11: work as expected when char not found in datafiles

3.3.0

  • Drop support for Python 2

  • Drop support for Python < 3.7, add support for Python up to 3.12

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

  • Update unicode data

Metadata

Release files for confusable-homoglyphs 3.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for confusable-homoglyphs 3.3.1
File Size Uploaded Provenance
confusable_homoglyphs-3.3.1.tar.gz 325.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for confusable-homoglyphs 3.3.1
File Interpreter ABI Platform
confusable_homoglyphs-3.3.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 470.2 kB

Release files / confusable_homoglyphs-3.3.1.tar.gz

Download URL confusable_homoglyphs-3.3.1.tar.gz
Size 325.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b995001c9b2e1b4cea0cf5f3840a7c79188a8cbbad053d693572bd8c1c1ec460
BLAKE2b-256 checksum
How to use checksums
0d101358fca1ee2d97d4f2877df9ffbe6d124da666fef3b2f75e771a4c1afee6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / confusable_homoglyphs-3.3.1-py2.py3-none-any.whl

Download URL confusable_homoglyphs-3.3.1-py2.py3-none-any.whl
Size 144.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
84c92cb79dc7f55aa290d0762b2349abd8dee4c16fbe6f99eac978d394e2e6a1
BLAKE2b-256 checksum
How to use checksums
c56ec0fcbb7d341a46cf4241a6aa9e6a737734f0657521fc1bcd074953fe4eea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for confusable-homoglyphs 3.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page