{"id":585,"library":"text-unidecode","title":"text-unidecode","description":"text-unidecode is a basic and lightweight Python port of the Perl Text::Unidecode library. It converts Unicode text into a 'good enough' 7-bit ASCII representation by performing context-free, character-by-character transliteration. The current version is 1.3, released in 2019, indicating a stable but infrequently updated project.","status":"active","version":"1.3","language":"python","source_language":"en","source_url":"https://github.com/kmike/text-unidecode/","tags":["text processing","unicode","transliteration","slugification","ascii"],"install":[{"cmd":"pip install text-unidecode","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"unidecode","correct":"from text_unidecode import unidecode"}],"quickstart":{"code":"from text_unidecode import unidecode\n\nunicode_text = \"Héllø Wörld! Како си? 北亰\"\nascii_text = unidecode(unicode_text)\n\nprint(f\"Original: {unicode_text}\")\nprint(f\"ASCII: {ascii_text}\")\n\n# Example with specific characters\nunicode_german = \"Äpfel, Öfen, Übermut\"\nascii_german = unidecode(unicode_german)\nprint(f\"German Original: {unicode_german}\")\nprint(f\"German ASCII: {ascii_german}\")","lang":"python","description":"Demonstrates how to import the `unidecode` function and use it to transliterate a Unicode string into a basic ASCII equivalent."},"warnings":[{"fix":"For critical applications, evaluate the output carefully or pre-process strings for specific language rules. For better transliteration quality, consider language-specific libraries or the alternative 'unidecode' package if its license is acceptable.","message":"text-unidecode performs basic, context-free character-by-character transliteration. This can lead to inaccurate or unexpected results for languages with complex writing systems (e.g., Japanese, Thai) or for characters with language-specific transliteration conventions (e.g., German umlauts, which are mapped to 'A', 'O', 'U' instead of 'Ae', 'Oe', 'Ue'). It's not designed for high-quality, language-aware transliteration.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If output stability is crucial (e.g., for URL slugs), either store the generated ASCII string in a database or pin the 'text-unidecode' dependency to a specific version to prevent unexpected changes.","message":"The transliteration tables within the library can be updated in future versions to improve mappings or fix inconsistencies. This means that the ASCII output for a given Unicode input might change between versions, potentially breaking systems that rely on consistent, stable ASCII representations (e.g., for generating unique URL slugs or identifiers).","severity":"breaking","affected_versions":"All versions, especially across major updates (though this library is stable, the underlying principle applies)"},{"fix":"Review project licensing requirements and compare `text-unidecode` with the `unidecode` library to choose the best fit for quality and license compatibility.","message":"The `text-unidecode` project's own documentation suggests an alternative library, `unidecode`, which is also a port of Text::Unidecode. It states that `unidecode` offers 'better memory usage and better transliteration quality' but is GPL-licensed. Users should evaluate `unidecode` if their project is compatible with GPL and requires potentially superior results.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.3':46 '2019':49 '7':28 'ascii':30,62 'basic':9 'bit':29 'charact':38,40 'character-by-charact':37 'context':35 'context-fre':34 'convert':21 'current':43 'enough':27 'free':36 'good':26 'indic':50 'infrequ':54 'librari':19 'lightweight':11 'perform':33 'perl':16 'port':13 'process':58 'project':56 'python':12 'releas':47 'represent':31 'slugif':61 'stabl':52 'text':2,5,17,23,57 'text-unidecod':1,4 'transliter':41,60 'unicod':22,59 'unidecod':3,6,18 'updat':55 'version':44","created_at":"2026-03-28T15:20:05.321445+00:00","updated_at":"2026-04-16T22:51:57.031915+00:00","problems":[{"fix":"pip install text-unidecode","cause":"The `text-unidecode` Python package, which provides the `unidecode` module, has not been installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'unidecode'"},{"fix":"Use `unidecode.unidecode('your text')` or import the function directly with `from unidecode import unidecode` and then call `unidecode('your text')`.","cause":"After `import unidecode`, the user is trying to call the entire module as a function instead of accessing the specific `unidecode` function within it.","error":"TypeError: 'module' object is not callable"},{"fix":"Use the correct module name in your import statement: `from unidecode import unidecode` or `import unidecode`.","cause":"The user is attempting to import a module named `text_unidecode`, but the actual module name provided by the `text-unidecode` package is `unidecode`.","error":"ModuleNotFoundError: No module named 'text_unidecode'"},{"fix":"Import the function before using it: `from unidecode import unidecode`","cause":"The `unidecode` function was called without being imported first from the `unidecode` module.","error":"NameError: name 'unidecode' is not defined"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"1.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/kmike/text-unidecode","docs":null,"changelog":null,"pypi":"https://pypi.org/project/text-unidecode/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":"verified"}}