Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a library for Python that gives the script name for a given unicode character or string?

Tags:

python

unicode

Is there a library that tells what script a particular unicode character belongs to?

For example for the input "u'ሕ'" it should return Ethiopic or similar.

like image 713
donatello Avatar asked Jan 26 '26 20:01

donatello


1 Answers

Maybe the data in the unicodedata module is what you are looking for:

print unicodedata.name(u"ሕ")

prints

ETHIOPIC SYLLABLE HHE

The printed name can be used to look up the corresponding character:

unicodedata.lookup("ETHIOPIC SYLLABLE HHE")
like image 151
Sven Marnach Avatar answered Jan 29 '26 08:01

Sven Marnach



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!