text-unidecode

The most basic Python port of Perl's Text::Unidecode for Unicode-to-ASCII transliteration.

Library
PyPI
v1.3
69stars
Artistic License / GPL

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
33/100Needs Attention
Development Activity0
Maintenance20
Community40
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
69/100Good
Architecture60
Code Quality65
Innovation55
Learning Curve95

text-unidecode is a tiny, dependency-free Python library that transliterates arbitrary Unicode text into a plain ASCII approximation. It is a direct port of the venerable Perl Text::Unidecode module and exposes a single unidecode() function that maps each code point to a best-effort ASCII replacement using a precompiled data table.

Because it ships as a permissively dual-licensed (Artistic / GPL) package with no runtime dependencies, it is a popular low-level building block deep in the dependency trees of many Python projects that need to romanize text for slugs, filenames, or search keys.

What You Get

  • A single unidecode() function that transliterates any Unicode string to ASCII
  • Zero runtime dependencies and a very small install footprint
  • A precompiled data.bin code-point replacement table loaded at import
  • Permissive dual licensing (Artistic License or GPL/GPLv2+)
  • Broad Python support (2.7 and 3.4+)

Common Use Cases

  • Generating ASCII-safe URL slugs from Unicode titles
  • Producing safe filenames or identifiers from international text
  • Normalizing text into ASCII search or sort keys
  • Feeding legacy systems or protocols that only accept ASCII

Under The Hood

Architecture - The entire library is src/text_unidecode/__init__.py: at import it reads a bundled data.bin via pkgutil.get_data, decodes it as UTF-8, and splits on NUL bytes into a _replaces list indexed by code point. unidecode() walks each character, looks up _replaces[ord(ch)-1], and joins the results, appending NUL for a zero code point and skipping unmapped ones.

Tech Stack - Pure Python (2.7 and 3.4+) with no third-party runtime dependencies. The only data artifact is the precompiled data.bin table, and a Perl helper (_dump.pl) is included for regenerating that table from the original Text::Unidecode source.

Code Quality - The implementation is a few lines and paired with test_unidecode.py plus a tox.ini for multi-version testing. It is production-stable and intentionally frozen, so it carries little risk despite low recent activity.

API Design - The surface could not be simpler: import unidecode and call it with a string. There are no options or configuration, which makes it trivial to adopt and impossible to misuse.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search