Package: jaconv
jaconvjaconv (Japanese Converter) is interconverter for Hiragana, Katakana, Hankaku (half-width character) and Zenkaku (full-width character)Japanese READMEis available.INSTALLATION$ pip install jaconvUSAGESee alsodocumentimportjaconv# Hiragana to Katakanajaconv.hira2kata('ともえまみ')# => 'トモエマミ'# Hiragana to half-width Katakanajaconv.hira2hkata('ともえまみ')# => 'ﾄﾓｴﾏﾐ'# Katakana to Hiraganajaconv.kata2hira('巴マミ')# => '巴まみ'# half-width character to full-width character# default parameters are followings: kana=True, ascii=False, digit=Falsejaconv.h2z('ﾃｨﾛ･ﾌｨﾅｰﾚ')# => 'ティロ・フィナーレ'# half-width character to full-width character# but only ascii charactersjaconv.h2z('abc',kana=False,ascii=True,digit=False)# => 'ａｂｃ'# half-width character to full-width character# but only digit charactersjaconv.h2z('123',kana=False,ascii=False,digit=True)# => '１２３'# half-width character to full-width character# except half-width Katakanajaconv.h2z('ｱabc123',kana=False,digit=True,ascii=True)# => 'ｱａｂｃ１２３'# an alias of h2zjaconv.hankaku2zenkaku('ﾃｨﾛ･ﾌｨﾅｰﾚabc123')# => 'ティロ・フィナーレabc123'# full-width character to half-width character# default parameters are followings: kana=True, ascii=False, digit=Falsejaconv.z2h('ティロ・フィナーレ')# => 'ﾃｨﾛ・ﾌｨﾅｰﾚ'# full-width character to half-width character# but only ascii charactersjaconv.z2h('ａｂｃ',kana=False,ascii=True,digit=False)# => 'abc'# full-width character to half-width character# but only digit charactersjaconv.z2h('１２３',kana=False,ascii=False,digit=True)# => '123'# full-width character to half-width character# except full-width Katakanajaconv.z2h('アａｂｃ１２３',kana=False,digit=True,ascii=True)# => 'アabc123'# an alias of z2hjaconv.zenkaku2hankaku('ティロ・フィナーレａｂｃ１２３')# => 'ﾃｨﾛ･ﾌｨﾅｰﾚａｂｃ１２３'# normalizejaconv.normalize('ティロ･フィナ〜レ','NFKC')# => 'ティロ・フィナーレ'# Hiragana to alphabetjaconv.kana2alphabet('じゃぱん')# => 'japan'# Alphabet to Hiraganajaconv.alphabet2kana('japan')# => 'じゃぱん'# Katakana to Alphabetjaconv.kata2alphabet('ケツイ')# => 'ketsui'# Alphabet to Katakanajaconv.alphabet2kata('namba')# => 'ナンバ'# Hiragana to Julius's phoneme formatjaconv.hiragana2julius('てんきすごくいいいいいい')# => 't e N k i s u g o k u i:'NOTEjaconv.normalize method expand unicodedata.normalize for Japanese language processing.'〜' => 'ー'
'～' => 'ー'
"’" => "'"
'”'=> '"'
'“' => '``'
'―' => '-'
'‐' => '-'
'˗' => '-'
'֊' => '-'
'‐' => '-'
'‑' => '-'
'‒' => '-'
'–' => '-'
'⁃' => '-'
'⁻' => '-'
'₋' => '-'
'−' => '-'
'﹣' => 'ー'
'－' => 'ー'
'—' => 'ー'
'―' => 'ー'
'━' => 'ー'
'─' => 'ー'CHANGES0.3.4 (2023-2-18)Fix to support Python2.7 ~ 3.4 (thanks @manjuu-eater)Support Python 3.110.3.3 (2022-12-31)Support Python 3.10Re-support Python2.7 ~ 3.4 (thanks @manjuu-eater)Fix z2h, h2z all flag off bug (thanks @manjuu-eater)0.3.1 (2022-12-14)Fix alpha2kana infinite loop bug (thanks @frog42)0.3 (2021-03-29)Fix bug (alphabet2kana) thanks @Cuddlemuffin007Support Python 3.8 and 3.9Add handy functions: alphabet2kata and kata2alphabet. thanks @kokimameAdd function for julius: hiragana2julius0.2.4 (2018-02-04)Fix bug (kana2alphabet)Support Python 3.7No longer support Python 2.6Add aliases of z2h -> zenkaku2hankaku and h2z -> hankaku2zenkaku0.2.3 (2018-02-03)Fix bugs (alphabet2kana, kana2alphabet) thanks @letuananh0.2.2 (2018-01-22)Fix bug (kana2alphabet) thanks @kokimameSupport Python 3.60.2.1 (2017-09-14)Fix bugs (alphabet2kana, kana2alphabet)0.2 (2015-04-02)Change module name jctconv -> jaconvAdd alphabet and hiragana interconvert (alphabet2kana, kana2alphabet)0.1.1 (2015-03-12)Support WindowsSupport Python 3.50.1 (2014-11-24)Add some Japanese characters to convert table (ゝゞ・「」。、)Decresing memory usageSome function names are deprecated (hankaku2zenkaku, zenkaku2hankaku, H2K, H2hK, K2H)0.0.7 (2014-03-22)z2h and h2z allow mojimoji-like target character type determination.
Bug fix about Half Kana conversion.