Registry / serialization / anyascii

anyascii

JSON →
library0.3.3pypypi✓ verified 25d ago

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.

pip install anyascii
INSTALL
IMPORT
SIG · ANYASCII
A
anyascii
serializationpythonv0.3.3
Install
1.7s avg
Import
49ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.050s · 20.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.048s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

anyascii
from anyascii import anyascii

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}'")
Debug
Known issues
breakingPython 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`).
fix
Upgrade to Python 3 or restrict `anyascii` version to `<0.2` in `requirements.txt`.
affects: >=0.2.0
gotchaTransliteration 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.
fix
Understand that the output is an ASCII approximation and not a round-trip conversion. For critical applications, review the transliterated output.
affects: All versions
gotcha`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.
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`).
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'anyascii'
The 'anyascii' module is not installed in the Python environment.
fix
Install the module using pip: 'pip install anyascii'.
ImportError: cannot import name 'anyascii' from 'anyascii'
Incorrect import statement; 'anyascii' is a function within the 'anyascii' module.
fix
Use the correct import statement: 'from anyascii import anyascii'.
TypeError: 'module' object is not callable
Attempting to call the module directly instead of the function within it.
fix
Call the function explicitly: 'from anyascii import anyascii; anyascii("string")'.
AttributeError: module 'anyascii' has no attribute 'anyascii'
This error occurs when the user has imported the specific 'anyascii' function using `from anyascii import anyascii` but then incorrectly tries to access it again as an attribute of the module (e.g., `anyascii.anyascii('text')`).
fix
After `from anyascii import anyascii`, call the function directly: `anyascii('text')`
NameError: name 'anyascii' is not defined
This usually happens when the user has imported the module as `import anyascii` but then tries to call the function directly as `anyascii('text')` instead of `anyascii.anyascii('text')`.
fix
If `import anyascii` is used, call the function as `anyascii.anyascii('text')`. Alternatively, use `from anyascii import anyascii` and then call `anyascii('text')`.
Upgrade
Version history
0.3.3latest on PyPI · released Jun 29, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
32
Amazon
1
OpenAI (training)
1
Resources
anyascii — pip install anyascii · libregistry