wchartype
wchartype is a Python module for getting the types of double-byte (full-width) characters. It has no external dependencies.
wchartype is licensed under the MIT license.
Usage
import wchartype
if wchartype.is_asian(u'\u65e5'):
print u"\u65e5 is an Asian character"
Function Specification
- is_asian
- True if the character is Asian (char code greater than 0x3000)
- is_full_width
- AKA Zenkaku -- True if Asian or an ideographic space.
- is_kanji
- True if Kanji character (or Chinese)
- is_hanzi
- Alias for is_kanji
- is_hiragana
- True if hiragana
- is_katakana
- True if full-width katakana
- is_half_katakana
- True if half-width katakana
- is_hangul
- True if full or half-width Hangul character
- is_full_punct
- True if full-width punctuation
- is_full_digit
- True if full-width digit
- is_full_letter
- True if full-width letter. Differs from built-in isalpha method in that isalpha will return True for CJK characters.
Documentation
Epydoc-generated documentation for the wchartype module can be found here.