Registry / data / tangled-up-in-unicode

tangled-up-in-unicode

JSON →
library0.2.0pypypi✓ verified 84d ago

Tangled Up in Unicode is a Python library, currently at version 0.2.0, that provides access to the Unicode Character Database (UCD). It serves as an alternative to Python's standard `unicodedata` module, offering the latest UCD versions and extended character properties. Releases are typically aligned with new Unicode Standard versions.

pip install tangled-up-in-unicode
INSTALL
IMPORT
SIG · TANGLED-UP-IN-UNIC
T
tangled-up-in-unicode
datapythonv0.2.0
Install
7.9s avg
Import
7605ms
Disk
84MB
Pass rate
2/ 10
Env Coverage2 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.0 · 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
glibc
py 3.10
✕ timeout
✕ timeout
py 3.11
✕ timeout
✕ timeout
py 3.12
✕ timeout
✕ timeout
py 3.13
✕ timeout
✕ timeout
py 3.9
✓ —
✓ 7.88s
84MB installed
● package 84MB
Code
Verified usage

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

tangled_up_in_unicode
import tangled_up_in_unicode as unicodedata
Commonly imported as 'unicodedata' for compatibility and ease of use, replacing the standard library module with an updated and extended version.

Demonstrates how to import and use `tangled-up-in-unicode` to retrieve character properties, including extended ones and aliases not available in the standard `unicodedata` module, and to check the UCD version.

import tangled_up_in_unicode as unicodedata char = '$' print(f"--- Properties for '{char}' ---") print(f"Name: {unicodedata.name(char)}") print(f"Category (Short): {unicodedata.category(char)}") print(f"Bidirectional (Short): {unicodedata.bidirectional(char)}") # This library provides more properties and aliases than standard unicodedata print(f"Script (Long): {unicodedata.script(char, long=True)}") print(f"Block (Long): {unicodedata.block(char, long=True)}") print(f"UCD Version: {unicodedata.unidata_version}")
Debug
Known issues
gotchaInstalling `tangled-up-in-unicode` can result in a very large `site-packages` directory (up to 1.8GB or more in a `venv`) due to the size of generated `.pyc` files from large internal data dictionaries.
fix
Be aware of disk space consumption when including this library, especially in constrained environments or when creating many virtual environments. Consider if the full UCD data is necessary or if a more lightweight approach is feasible for specific use cases. Future versions may address this by changing data storage formats.
affects: All versions up to 0.2.0
gotchaPrior to version 0.0.7, querying for a script that was not in the lookup table would raise an `IndexError`. From version 0.0.7 onwards, this behavior changed to return the string 'Unknown' instead.
fix
If your application relies on catching `IndexError` for unknown scripts, update your code to expect 'Unknown' for versions 0.0.7 and later. For backward compatibility, check the library version or explicitly handle both `IndexError` (for older versions) and the 'Unknown' string (for newer versions).
affects: < 0.0.7
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tangled_up_in_unicode'
The 'tangled-up-in-unicode' library is either not installed in the current Python environment or is misspelled in the import statement.
fix
Install the library using `pip install tangled-up-in-unicode` and ensure the import is `import tangled_up_in_unicode` or `from tangled_up_in_unicode import UCD`.
AttributeError: module 'tangled_up_in_unicode' has no attribute 'name'
The library's functionality (like `name()`) is exposed through an instance of the `UCD` class, not as direct module-level functions.
fix
First, create a `UCD` object: `from tangled_up_in_unicode import UCD; ucd = UCD()`. Then, call the method on the object: `ucd.name('A')`.
AttributeError: 'UCD' object has no attribute 'version'
The `UCD` object exposes the Unicode Character Database version via the `ucd_version` attribute, not `version`.
fix
Access the version using the correct attribute name: `ucd.ucd_version`.
ImportError: cannot import name 'UCD' from 'tangled_up_in_unicode'
The main `UCD` class is being imported with incorrect casing (e.g., `ucd`) or a typo, or the module itself is corrupted.
fix
Ensure the import statement uses the exact class name: `from tangled_up_in_unicode import UCD`.
Upgrade
Version history
0.2.0latest on PyPI · released Sep 27, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
10
OpenAI (training)
2
Resources
tangled-up-in-unicode — pip install tangled-up-in-unicode · libregistry