Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Pure-Python Japanese character interconverter for Hiragana, Katakana, Hankaku and Zenkaku

Project Description

jaconv

jaconv (Japanese Converter) is interconverter for Hiragana, Katakana, Hankaku (half-width character) and Zenkaku (full-width character)

INSTALLATION

$ pip install jaconv

USAGE

import jaconv

# Hiragana to Katakana
jaconv.hira2kata(u'ともえまみ')
# => u'トモエマミ'

# Hiragana to half-width Katakana
jaconv.hira2hkata(u'ともえまみ')
# => u'トモエマミ'

# Katakana to Hiragana
jaconv.kata2hira(u'巴マミ')
# => u'巴まみ'

# half-width character to full-width character
jaconv.h2z(u'ティロ・フィナーレ')
# => u'ティロ・フィナーレ'

# half-width character to full-width character
# but only ascii characters
jaconv.h2z(u'abc', ascii=True)
# => u'abc'

# half-width character to full-width character
# but only digit characters
jaconv.h2z(u'123', digit=True)
# => u'123'

# half-width character to full-width character
# except half-width Katakana
jaconv.h2z(u'アabc123', kana=False, digit=True, ascii=True)
# => u'アabc123'

# full-width character to half-width character
jaconv.z2h(u'ティロ・フィナーレ')
# => u'ティロ・フィナーレ'

# full-width character to half-width character
# but only ascii characters
jaconv.z2h(u'abc', ascii=True)
# => u'abc'

# full-width character to half-width character
# but only digit characters
jaconv.z2h(u'123', digit=True)
# => u'123'

# full-width character to half-width character
# except full-width Katakana
jaconv.z2h(u'アabc123', kana=False, digit=True, ascii=True)
# => u'アabc123'

# normalize
jaconv.normalize(u'ティロ・フィナ〜レ', 'NFKC')
# => u'ティロ・フィナーレ'

# Hiragana to alphabet
jaconv.kana2alphabet(u'じゃぱん')
# => japan

# Alphabet to Hiragana
jaconv.alphabet2kana(u'japan')
# => じゃぱん

NOTE

jaconv.normalize method expand unicodedata.normalize for Japanese language processing.

'〜' => 'ー'
'~' => 'ー'
"’" => "'"
'”'=> '"'
'“' => '``'
'―' => '-'
'‐' => '-'
'˗' => '-'
'֊' => '-'
'‐' => '-'
'‑' => '-'
'‒' => '-'
'–' => '-'
'⁃' => '-'
'⁻' => '-'
'₋' => '-'
'−' => '-'
'﹣' => 'ー'
'-' => 'ー'
'—' => 'ー'
'―' => 'ー'
'━' => 'ー'
'─' => 'ー'

CHANGES

0.2.1 (2017-09-14)

  • Fix bugs (alphabet2kana, kana2alphabet)

0.2 (2015-04-02)

  • Change module name jctconv -> jaconv
  • Add alphabet and hiragana interconvert (alphabet2kana, kana2alphabet)

0.1.1 (2015-03-12)

  • Support Windows
  • Support Python 3.5

0.1 (2014-11-24)

  • Add some Japanese characters to convert table (ゝゞ・「」。、)
  • Decresing memory usage
  • Some 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.

Release History

Release History

This version
History Node

0.2.1

History Node

0.2.0

History Node

0.2

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jaconv-0.2.1.tar.gz (9.6 kB) Copy SHA256 Checksum SHA256 Source Sep 13, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting