{"id":1322,"library":"anyascii","title":"AnyASCII","description":"anyascii is a Python library that provides fast and accurate Unicode to ASCII transliteration. It converts any Unicode string into an ASCII representation, making it suitable for filenames, URLs, or other contexts where only ASCII characters are permitted. The current version is 0.3.3, and it maintains a relatively stable release cadence with updates for data improvements or internal packaging.","status":"active","version":"0.3.3","language":"en","source_language":"en","source_url":"https://github.com/anyascii/anyascii","tags":["unicode","ascii","transliteration","text-processing"],"install":[{"cmd":"pip install anyascii","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"anyascii","correct":"from anyascii import anyascii"}],"quickstart":{"code":"from anyascii import anyascii\n\n# Example 1: Basic transliteration\ntext1 = '你好，世界'\nresult1 = anyascii(text1)\nprint(f\"'{text1}' -> '{result1}'\")\n\n# Example 2: European characters\ntext2 = 'Hello, world! Pýthön æøåß®©'\nresult2 = anyascii(text2)\nprint(f\"'{text2}' -> '{result2}'\")\n\n# Example 3: Mixed script\ntext3 = 'Ελληνικά, Русский, 日本語'\nresult3 = anyascii(text3)\nprint(f\"'{text3}' -> '{result3}'\")","lang":"python","description":"Demonstrates the basic usage of the `anyascii` function to transliterate various Unicode strings into their ASCII equivalents."},"warnings":[{"fix":"Upgrade to Python 3 or restrict `anyascii` version to `<0.2` in `requirements.txt`.","message":"Python 2 support was dropped in version 0.2.0. If your project requires Python 2 compatibility, you must pin the `anyascii` version to `<0.2` (e.g., `anyascii==0.1.7`).","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Understand that the output is an ASCII approximation and not a round-trip conversion. For critical applications, review the transliterated output.","message":"Transliteration is an inherently lossy process. While `anyascii` provides a robust ASCII representation, it may not perfectly preserve all semantic or linguistic nuances of the original Unicode string. Users should be aware that the output is a best-effort ASCII approximation.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If additional text normalization is required, use `anyascii` in conjunction with other string manipulation techniques or libraries (e.g., `str.lower()`, `str.strip()`, `unicodedata.normalize`).","message":"`anyascii` focuses purely on Unicode to ASCII transliteration. It does not perform other text normalization tasks such as lowercasing, stripping extra whitespace, or handling character compositions beyond what's necessary for direct ASCII mapping. For broader text cleaning, combine it with other libraries.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}