Tangled Up in Unicode

0.2.0 · active · verified Wed Apr 15

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.

Warnings

Install

Imports

Quickstart

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}")

view raw JSON →