Introduction to Unicodedata library lookup and name functions














































Introduction to Unicodedata library lookup and name functions



Python Library


Python is one of the most simplest languages and
these libraries contribute largely to its simplicity. A Python Library is one
which contains different modules and codes that can be used repeatedly in
different programs. These libraries help in simple and convenient coding in
python.


One such library defined here is Unicodedata
Library
. The functions in this library are:



1. unicodedata.lookup(name)

2. unicodedata.name(chr[, default])

3. unicodedata.decimal(chr[, default])

4. unicodedata.digit(chr[, default])

5. unicodedata.numeric(chr[, default])

6. unicodedata.category(chr)

7. unicodedata.bidirectional(chr)

8. unicodedata.combining(chr)

9. unicodedata.east_asian_width(chr)

10. unicodedata.mirrored(chr)

11. unicodedata.decomposition(chr)

12. unicodedata.normalize(form, unistr)

13. unicodedata.unidata_version

14. unicodedata.ucd_3_2_0


Unicodedata Library


Two of the functions defined here are unicodedata.lookup(name) and unicodedata.name(chr[,
default]).


Description:

The Unicodedata library in python is helpful in
defining the properties for all the Unicode characters available in the Unicode
Database. This library accesses the Unicode Character Database (UCD) for
defining the characters.

The UCD file link: https://www.unicode.org/Public/9.0.0/ucd/UnicodeData.txt


A brief description of Unicode:

The computers only understands the binary numbers.
Each and every characters we use is encoded into a particular using some
specified bits. Unicode is basically defined as the encoding standard used for
representation of text for computer processing. Unicode includes all the
possible characters from all languages we use nowadays, thus is helpful for
making it easier for us to work using our familiar characters.


FUNCTIONS: 


unicodedata.lookup(name):


Each character present in the Unicode Character
Database is given a particular name. 

This function takes in the name of the particular
character in the Unicode as an argument, and returns the character.




If no valid character name is provided then it
returns the KeyError.




unicodedata.name(chr[, default])


This is a function defined in the Unicodedata
library which gives the name of the character defined in the Unicode Character
Database (UCD). 




If no name is defined in the database corresponding
to the name provided as the argument, the it returns the the ValueError.








More Articles of Arkaja Sharan:

Name Views Likes
Python codecs Library Error Handling schemes module functions 77 0
Python codecs Library Error Handler register_error and lookup_error functions 71 0
Python codecs Library Error Handlers 76 0
Python codecs Library open and EncodedFile functions 66 0
Python codecs Library iterencode and iterdecode functions 85 0
Python codecs Library register and unregister functions 64 0
Python codecs Library getreader and getwriter functions 79 0
Python codecs Library getincrementalencoder and getincrementaldecoder 64 0
Python codecs Library getencoder and getdecoder functions 70 0
Python Introduction to codecs Library 99 0
Python fcntl Library flock and lockf functions 78 0
Python fcntl Library fcntl and ioctl functions 89 0
Python Resource Library resource usage functions 89 0
Python Resource Library resource usage symbolic constants 73 0
Python Resource Library Resource Limit Functions 86 0
Python resource library resource limit symbolic constants 80 0
Python Introduction to Resource Library 69 0
Python stringprep Library in_table_d1 and in_table_d2 functions 76 0
Python stringprep Library in_table_c8 and in_table_c9 functions 81 0
Python stringprep Library in_table_c5 in_table_c6 and in_table_c7 functions 68 0
Python stringprep Library in_table_c3 and in_table_c4 functions 75 0
Python stringprep library in_table_c21 in_table_c22 and in_table_c21_c22 77 0
Python stringprep library functions in_table_c11 in_table_c12 and in_table_c11_c12 77 0
Python Introduction to stringprep Library 79 0
Python unicodedata library is_normalized unidata_version and ucd_3_2_0 75 0
Python Unicodedata Library functions normalize and decomposition 130 0
Python Unicodedata Library functions east_asian_width and mirrored 82 1
Python Unicodedata Library category bidirectional and combining functions 114 0
Introduction to Unicodedata library lookup and name functions 79 0
Unicode Library decimal digit and numeric functions 80 0
Introduction to Unicode Data library 0 0

Comments