AnyASCII

0.3.3 · active · verified Thu Apr 09

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.

Warnings

Install

Imports

Quickstart

Demonstrates the basic usage of the `anyascii` function to transliterate various Unicode strings into their ASCII equivalents.

from anyascii import anyascii

# Example 1: Basic transliteration
text1 = '你好,世界'
result1 = anyascii(text1)
print(f"'{text1}' -> '{result1}'")

# Example 2: European characters
text2 = 'Hello, world! Pýthön æøåß®©'
result2 = anyascii(text2)
print(f"'{text2}' -> '{result2}'")

# Example 3: Mixed script
text3 = 'Ελληνικά, Русский, 日本語'
result3 = anyascii(text3)
print(f"'{text3}' -> '{result3}'")

view raw JSON →