python-clinic / Doc / library / unicodedata.rst

:mod:`unicodedata` --- Unicode Database

This module provides access to the Unicode Character Database (UCD) which defines character properties for all Unicode characters. The data contained in this database is compiled from the UCD version 6.2.0.

The module uses the same names and symbols as defined by Unicode Standard Annex #44, "Unicode Character Database". It defines the following functions:

In addition, the module exposes the following constant:


>>> import unicodedata
>>> unicodedata.lookup('LEFT CURLY BRACKET')
>>> unicodedata.decimal('9')
>>> unicodedata.decimal('a')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: not a decimal
>>> unicodedata.category('A')  # 'L'etter, 'u'ppercase
>>> unicodedata.bidirectional('\u0660') # 'A'rabic, 'N'umber