Pure-Python Japanese character interconverter for Hiragana, Katakana, Hankaku, Zenkaku and more
|travis| |coveralls| |pyversion| |version| |license| |download|
jaconv (Japanese Converter) is interconverter for Hiragana, Katakana, Hankaku (half-width character) and Zenkaku (full-width character)
Japanese README <https://github.com/ikegami-yukino/jaconv/blob/master/README_JP.rst>
_ is available.
::
$ pip install jaconv
See also document <http://ikegami-yukino.github.io/jaconv/jaconv.html>
_
.. code:: python
import jaconv
jaconv.hira2kata('ともえまみ')
jaconv.hira2hkata('ともえまみ')
jaconv.kata2hira('巴マミ')
jaconv.h2z('ティロ・フィナーレ')
jaconv.h2z('abc', kana=False, ascii=True, digit=False)
jaconv.h2z('123', kana=False, ascii=False, digit=True)
jaconv.h2z('アabc123', kana=False, digit=True, ascii=True)
jaconv.hankaku2zenkaku('ティロ・フィナーレabc123')
jaconv.z2h('ティロ・フィナーレ')
jaconv.z2h('abc', kana=False, ascii=True, digit=False)
jaconv.z2h('123', kana=False, ascii=False, digit=True)
jaconv.z2h('アabc123', kana=False, digit=True, ascii=True)
jaconv.zenkaku2hankaku('ティロ・フィナーレabc123')
jaconv.normalize('ティロ・フィナ〜レ', 'NFKC')
jaconv.kana2alphabet('じゃぱん')
jaconv.alphabet2kana('japan')
jaconv.kata2alphabet('ケツイ')
jaconv.alphabet2kata('namba')
jaconv.hiragana2julius('てんきすごくいいいいいい')
jaconv.normalize method expand unicodedata.normalize for Japanese language processing.
.. code::
'〜' => 'ー'
'~' => 'ー'
"’" => "'"
'”'=> '"'
'“' => '``'
'―' => '-'
'‐' => '-'
'˗' => '-'
'֊' => '-'
'‐' => '-'
'‑' => '-'
'‒' => '-'
'–' => '-'
'⁃' => '-'
'⁻' => '-'
'₋' => '-'
'−' => '-'
'﹣' => 'ー'
'-' => 'ー'
'—' => 'ー'
'―' => 'ー'
'━' => 'ー'
'─' => 'ー'
.. |travis| image:: https://travis-ci.org/ikegami-yukino/jaconv.svg?branch=master :target: https://travis-ci.org/ikegami-yukino/jaconv :alt: travis-ci.org
.. |coveralls| image:: https://coveralls.io/repos/ikegami-yukino/jaconv/badge.svg?branch=master&service=github :target: https://coveralls.io/github/ikegami-yukino/jaconv?branch=master :alt: coveralls.io
.. |pyversion| image:: https://img.shields.io/pypi/pyversions/jaconv.svg
.. |version| image:: https://img.shields.io/pypi/v/jaconv.svg :target: http://pypi.python.org/pypi/jaconv/ :alt: latest version
.. |license| image:: https://img.shields.io/pypi/l/jaconv.svg :target: http://pypi.python.org/pypi/jaconv/ :alt: license
.. |download| image:: https://static.pepy.tech/personalized-badge/neologdn?period=total&units=international_system&left_color=black&right_color=blue&left_text=Downloads :target: https://pepy.tech/project/neologdn :alt: download
z2h and h2z allow mojimoji-like target character type determination. Bug fix about Half Kana conversion.