• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    Python
  • License
    Other
  • Created almost 12 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🈂️ A Romaji/Kana conversion library for Python

python-romkan

Build Status PyPI version

python-romkan is a Romaji/Kana conversion library for Python, which is used to convert a Japanese Romaji (ローマ字) string to a Japanese Kana (仮名) string or vice versa.

It is the Pythonic port of Ruby/Romkan, originally authored by Satoru Takabayashi and ported by Masato Hagiwara.

python-romkan works on Python 2 and Python 3 (fully tested on Python 2.6, 2.7, 3.2, 3.3 and PyPy). It handles both Katakana (片仮名) and Hiragana (平仮名) with the Hepburn (ヘボン式) romanization system, as well as the modern Kunrei-shiki (訓令式) romanization system.

Project homepage: http://www.soimort.org/python-romkan

Fork me on GitHub: https://github.com/soimort/python-romkan

Installation

1. Install via Pip:

$ pip install romkan

2. Install via EasyInstall:

$ easy_install romkan

3. Install from Git:

$ git clone git://github.com/soimort/python-romkan.git
$ python setup.py install

Usage

Python 3.x:

$ python
>>> import romkan
>>> print(romkan.to_roma("にんじゃ"))
ninja
>>> print(romkan.to_hepburn("にんじゃ"))
ninja
>>> print(romkan.to_kunrei("にんじゃ"))
ninzya
>>> print(romkan.to_hiragana("ninja"))
にんじゃ
>>> print(romkan.to_katakana("ninja"))
ニンジャ

Python 2.x:

$ python2
>>> import romkan
>>> print romkan.to_roma(u"にんじゃ")
ninja
>>> print romkan.to_hepburn(u"にんじゃ")
ninja
>>> print romkan.to_kunrei(u"にんじゃ")
ninzya
>>> print romkan.to_hiragana("ninja")
にんじゃ
>>> print romkan.to_katakana("ninja")
ニンジャ

API Reference

  • to_katakana(string)

Convert a Romaji (ローマ字) to a Katakana (片仮名).

  • to_hiragana(string)

Convert a Romaji (ローマ字) to a Hiragana (平仮名).

  • to_kana(string)

Convert a Romaji (ローマ字) to a Katakana (片仮名). (same as to_katakana)

  • to_hepburn(string)

Convert a Kana (仮名) or a Kunrei-shiki Romaji (訓令式ローマ字) to a Hepburn Romaji (ヘボン式ローマ字).

  • to_kunrei(string)

Convert a Kana (仮名) or a Hepburn Romaji (ヘボン式ローマ字) to a Kunrei-shiki Romaji (訓令式ローマ字).

  • to_roma(string)

Convert a Kana (仮名) to a Hepburn Romaji (ヘボン式ローマ字).

License

python-romkan is licensed under the BSD license.

More Repositories

1

you-get

⏬ Dumb downloader that scrapes the web
Python
50,349
star
2

translate-shell

💬 Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.
Awk
6,539
star
3

wiki

HTML
78
star
4

GrassMudHorse

An implementation of GrassMudHorse programming language in Haskell
Haskell
48
star
5

soimort.github.io

HTML
30
star
6

dotfiles

Mort's dotfiles
Python
20
star
7

SciTE-properties

Mort's SciTE editor configuration files
Awk
13
star
8

Copycat-Rootkit-Demo

Website-Terminal Copy-Paste can be dangerous.
Shell
12
star
9

nyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyannyan

Shell
11
star
10

awkunit

Unit Testing Framework for GNU Awk
C
10
star
11

akb48.js

AKB48 member profiles as a JavaScript library
JavaScript
9
star
12

mayuki

[INACTIVE] A minimalist Markdown/YAML-based static wiki generator
Ruby
8
star
13

anthy-kaomoji

Mort's collection of everyday use kaomojis
Ruby
8
star
14

my-ftpd

Very minimal FTP server / client
Java
7
star
15

idris-commonmark

Idris wrapper for jgm's Markdown parser
Idris
6
star
16

becat

Better cat(1), split(1) and cmp(1)
Tcl
6
star
17

resave

An image downloader
Tcl
5
star
18

pi

A simple pandoc wrapper that does the trick
Ruby
5
star
19

pi.clj

Calculates π to arbitrary precision using Machin's Formula.
Clojure
5
star
20

pandoc-filters

Mort's pandoc filters
Python
5
star
21

pride

🌈 Simple testing and logging with pride
C
5
star
22

hit-and-run

Handy tool for competitive programming
Shell
4
star
23

Arduino-Synth

Yet another Arduino Synthesizer
Arduino
4
star
24

codejam-commandline

Automatically exported from code.google.com/p/codejam-commandline
Python
4
star
25

p99

P-99: Ninety-Nine Prolog Problems (Mort's Solutions)
Ruby
4
star
26

google_plus_archiver

[INACTIVE] A simple command-line tool to archive Google+ profiles and public streams
Ruby
2
star
27

some-proofs

Coq
2
star
28

sfntwari

Strip TrueType fonts and convert to WOFF for use in web pages
Java
2
star
29

status

soimort Status
JavaScript
2
star
30

my-tint2

C
2
star
31

iGaME-GEM

[INACTIVE] An Educational Game for Synthetic Biology
2
star
32

project-euler

Mort's Solutions to Project Euler
Python
2
star
33

cpcat

a simple package management, file backup and synchronization script
Shell
2
star
34

mi-caja

just my own fork of the Caja file manager
C
1
star
35

frs48

Flight Reservation System in 48 hours
Java
1
star