Skip to main content

Python implementation of kakasi - kana kanji simple inversion library

Project description

Overview

Documentation Status Travis-CI PyPI version Coverage status Azure-Pipelines

pykakasi is re-implementation of kakasi library (original is written in C) in Python.

pykakasi at glance

Install:

pip install pykakasi

Sample source code:

from pykakasi import kakasi,wakati

text = u"かな漢字交じり文"
kakasi = kakasi()
kakasi.setMode("H","a") # Hiragana to ascii, default: no conversion
kakasi.setMode("K","a") # Katakana to ascii, default: no conversion
kakasi.setMode("J","a") # Japanese to ascii, default: no conversion
kakasi.setMode("r","Hepburn") # default: use Hepburn Roman table
kakasi.setMode("s", True) # add space, default: no separator
kakasi.setMode("C", True) # capitalize, default: no capitalize
conv = kakasi.getConverter()
result = conv.do(text)
print(result)

wakati = wakati()
conv = wakati.getConverter()
result = conv.do(text)
print(result)

You can use output Mode values from “H”, “K”, “a” which is each means “Hiragana”, “Katakana” and “Alphabet”. For input, you can use “J” that means “Japanese” that is mixture of Kanji, Katakana and Hiragana. Also there is values of “H”, “K” that means “Hiragana”, and “Katakana”. You can use “Hepburn” , “Kunrei” or “Passport” as mode “r”, Roman table switch. Also “s” used for separator switch, “C” for capitalize switch. “S” for separator storing option.

wakati is an implementation of kakasi’s wakati gaki option.

Documentation

Manual is placed on readthedocs.

Project details


Download files

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

Source Distribution

pykakasi-0.95.tar.gz (1.1 MB view hashes)

Uploaded Source

Built Distributions

pykakasi-0.95-pypy-none-any.whl (2.6 MB view hashes)

Uploaded Python p.y

pykakasi-0.95-py35-none-any.whl (2.7 MB view hashes)

Uploaded Python 3.5

pykakasi-0.95-py3-none-any.whl (2.6 MB view hashes)

Uploaded Python 3

pykakasi-0.95-py2-none-any.whl (2.7 MB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page