On this page
unicodedata.UCD
Prev: unicodedata.numeric | Up: unicodedata
Rel: unicodedata.bidirectional, unicodedata.category, unicodedata.combining, unicodedata.decimal
Ref: docs.python.org — unicodedata.UCD
Tags: #public #python3 #stdlib #unicodedata
Import
import unicodedata
from unicodedata import UCD
Signature & Overview
unicodedata.UCD()
unicodedata.UCD class.
Methods & Attributes
UCD.bidirectional(self, chr, /)— Returns the bidirectional class assigned to the character chr as string.UCD.category(self, chr, /)— Returns the general category assigned to the character chr as string.UCD.combining(self, chr, /)— Returns the canonical combining class assigned to the character chr as integer.UCD.decimal(...)— Converts a Unicode character into its equivalent decimal value.UCD.decomposition(self, chr, /)— Returns the character decomposition mapping assigned to the character chr as string.UCD.digit(...)— Converts a Unicode character into its equivalent digit value.UCD.east_asian_width(self, chr, /)— Returns the east asian width assigned to the character chr as string.UCD.is_normalized(self, form, unistr, /)— Return whether the Unicode string unistr is in the normal form 'form'.UCD.lookup(self, name, /)— Look up character by name.UCD.mirrored(self, chr, /)— Returns the mirrored property assigned to the character chr as integer.UCD.name(...)— Returns the name assigned to the character chr as a string.UCD.normalize(self, form, unistr, /)— Return the normal form 'form' for the Unicode string unistr.UCD.numeric(...)— Converts a Unicode character into its equivalent numeric value.
Usage
import unicodedata
ucd32 = unicodedata.ucd_3_2_0
assert isinstance(ucd32, unicodedata.UCD) and ucd32.unidata_version == '3.2.0'
Gotchas
- Used when matching legacy RFC 3454 / IDNA2003 Unicode 3.2 tables.
REPL Inspect
from unicodedata import UCD
help(UCD)
Linked from
Related notes
- tuts/python3/stdlib_module/unicodedata/numeric Linked here; links to this page; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/unicodedata/bidirectional Linked here; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/category Linked here; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/combining Linked here; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/decimal Linked here; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/decomposition shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/digit shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/east_asian_width shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/is_normalized shared tags: #stdlib, #unicodedata