Unicode Character Properties

Unicode Character Property Database

  • unicodedata module
  • Provides information about character properties (capitalization, numeric values, etc.)
     >>> import unicodedata
     >>> unicodedata.category(u'A')
     'Lu'
     >>> unicodedata.category(u'4')
     'Nd'
     >>> unicodedata.numeric(u'\u2155')  # \u2155 is fraction (1/5)
     0.2
     >>> 
<<< O'Reilly OSCON 2001, New Features in Python 2, Slide 60
July 26, 2001, beazley@cs.uchicago.edu
>>>