Skip to main content

A fast converter between Japanese hankaku and zenkaku characters

Project description

https://badge.fury.io/py/mojimoji.png https://github.com/studio-ousia/mojimoji/workflows/build%20manylinux/badge.svg https://github.com/studio-ousia/mojimoji/workflows/build%20macos%20and%20win/badge.svg

A fast converter between Japanese hankaku and zenkaku characters.

Installation

$ pip install mojimoji

Examples

Zenkaku to Hankaku

>>> import mojimoji
>>> print mojimoji.zen_to_han(u'アイウabc012')
アイウabc012
>>> print mojimoji.zen_to_han(u'アイウabc012', kana=False)
アイウabc012
>>> print mojimoji.zen_to_han(u'アイウabc012', digit=False)
アイウabc012
>>> print mojimoji.zen_to_han(u'アイウabc012', ascii=False)
アイウabc012

Hankaku to Zenkaku

>>> import mojimoji
>>> print mojimoji.han_to_zen(u'アイウabc012')
アイウabc012
>>> print mojimoji.han_to_zen(u'アイウabc012', kana=False)
アイウabc012
>>> print mojimoji.han_to_zen(u'アイウabc012', digit=False)
アイウabc012
>>> print mojimoji.han_to_zen(u'アイウabc012', ascii=False)
アイウabc012

Benchmarks

Library versions

Results

In [19]: s = u'ABCDEFG012345' * 10

In [20]: %time for n in range(1000000): mojimoji.zen_to_han(s)
CPU times: user 2.86 s, sys: 0.10 s, total: 2.97 s
Wall time: 2.88 s

In [21]: %time for n in range(1000000): unicodedata.normalize('NFKC', s)
CPU times: user 5.43 s, sys: 0.12 s, total: 5.55 s
Wall time: 5.44 s

In [22]: %time for n in range(1000000): zenhan.z2h(s)
CPU times: user 69.18 s, sys: 0.11 s, total: 69.29 s
Wall time: 69.48 s

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

mojimoji-0.0.10.dev1.tar.gz (42.6 kB view details)

Uploaded Source

Built Distributions

mojimoji-0.0.10.dev1-cp38-cp38-win_amd64.whl (35.6 kB view details)

Uploaded CPython 3.8 Windows x86-64

mojimoji-0.0.10.dev1-cp38-cp38-manylinux1_x86_64.whl (131.2 kB view details)

Uploaded CPython 3.8

mojimoji-0.0.10.dev1-cp38-cp38-macosx_10_13_x86_64.whl (41.7 kB view details)

Uploaded CPython 3.8 macOS 10.13+ x86-64

mojimoji-0.0.10.dev1-cp37-cp37m-win_amd64.whl (35.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

mojimoji-0.0.10.dev1-cp37-cp37m-manylinux1_x86_64.whl (127.4 kB view details)

Uploaded CPython 3.7m

mojimoji-0.0.10.dev1-cp37-cp37m-macosx_10_13_x86_64.whl (41.2 kB view details)

Uploaded CPython 3.7m macOS 10.13+ x86-64

mojimoji-0.0.10.dev1-cp36-cp36m-win_amd64.whl (35.2 kB view details)

Uploaded CPython 3.6m Windows x86-64

mojimoji-0.0.10.dev1-cp36-cp36m-manylinux1_x86_64.whl (126.3 kB view details)

Uploaded CPython 3.6m

mojimoji-0.0.10.dev1-cp36-cp36m-macosx_10_13_x86_64.whl (41.1 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

mojimoji-0.0.10.dev1-cp35-cp35m-win_amd64.whl (33.8 kB view details)

Uploaded CPython 3.5m Windows x86-64

mojimoji-0.0.10.dev1-cp35-cp35m-manylinux1_x86_64.whl (122.6 kB view details)

Uploaded CPython 3.5m

mojimoji-0.0.10.dev1-cp35-cp35m-macosx_10_13_x86_64.whl (38.1 kB view details)

Uploaded CPython 3.5m macOS 10.13+ x86-64

File details

Details for the file mojimoji-0.0.10.dev1.tar.gz.

File metadata

  • Download URL: mojimoji-0.0.10.dev1.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for mojimoji-0.0.10.dev1.tar.gz
Algorithm Hash digest
SHA256 59c42eeb805d5e6bf183b77581cd8332ab29229544accf898cdd35cb72834f63
MD5 8484d44c6278d1d4a32c2476ef3d97ae
BLAKE2b-256 364b980779a39b15b8d099079760ebdd85e4613d3b9ca266aa02499796bf0180

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for mojimoji-0.0.10.dev1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8988501084597bdd759826cfcdb1d6924d570d27aa2d60b48eaa159457c01f75
MD5 3578c4fb0c2bf092ffc22b137806f5be
BLAKE2b-256 49a053e1457e5eb7375bc1b89908833350a8b2e04854f433345234b0a1e72768

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 131.2 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for mojimoji-0.0.10.dev1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c1fbd8fa0e656b5efd13ae71931609030f0507ad588585d9f3a05468e33688c1
MD5 c0af20d58cc032a1c826704b84544a31
BLAKE2b-256 574ba3476b45780e709754f9a1f69511a8412a9f67babd4242316bdfd134f95d

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp38-cp38-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp38-cp38-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: CPython 3.8, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for mojimoji-0.0.10.dev1-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 3538ee6f581a1abbff73cf77b8dbfe80a3f203f538e9325a303fda2f56e542b1
MD5 7fa2b1ee8921bc39a9a940a03cdf7914
BLAKE2b-256 ca911b0e5971f7b0e1c8ad255081e880006d8f8a094ea7646f463ccbe569e8ed

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for mojimoji-0.0.10.dev1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 7322c1036c3073650dbb9153e6483e38c2f7101ff7f3b6a2290af5c2425a5276
MD5 8892deae2bd71ce68112c9e69c611151
BLAKE2b-256 2e5e89981a3665f0a115b026a12be110bca73a63aecff35735b74f668fab90a1

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 127.4 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for mojimoji-0.0.10.dev1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 79b3404cc15727415dfd3625692f2a1d100925a228db1515db577bca6033b498
MD5 e9867bac98832d174b9bb4e7058f3c59
BLAKE2b-256 7fe778e6e22137adcb4fb68bf7d3f5dba0eb5f2ca982f760975dc92348a0f407

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 41.2 kB
  • Tags: CPython 3.7m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for mojimoji-0.0.10.dev1-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 3c08ba601cac66854f24ce513b5e89ef89517d96437a98416fe2fffb1329f85d
MD5 e188d84fc7a526ea1f3b726e09cfd3e9
BLAKE2b-256 7882f04708f32d909afb58eae61b2ed78a393939ded7fcdc965fa3f262556c5c

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8

File hashes

Hashes for mojimoji-0.0.10.dev1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 6847b72ad7063a41468cc80d76aac4e82a0e7fa66afe00824593ddb26ad2f269
MD5 e14510f0214863c5c7a30fef395437df
BLAKE2b-256 d85b568a78f1aabff0acf9df5a38e51148e7945ecde6a722885bf3928dbdef26

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 126.3 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for mojimoji-0.0.10.dev1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cc66692ee1df18c43957ce316dd07c154a0bbaa04aabe34756ca002e3028488f
MD5 b1a38b850ef6954be36a8bc58ebcde7e
BLAKE2b-256 80c531bf3813885322769747c7b8efe6f88aee1dc8d3e3888004f59d69bc6aea

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp36-cp36m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: CPython 3.6m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for mojimoji-0.0.10.dev1-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a327e733c8df99eabe63cdf722acefdfde1958ed91f17253a21898d8041aaeb0
MD5 4ece9614a7f17dc4fba3d1a00ebc6b58
BLAKE2b-256 d93cf7d541e898d798c58c804c0c497fb2c152cf53d06e32bcc5c9390aeb593d

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.4

File hashes

Hashes for mojimoji-0.0.10.dev1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 fd10fbbf76ac4f99100edf2fe49b997dda2297f63097f936bd27b9da8083b29e
MD5 cf533667fe74eda4d4e946d0a0f84c82
BLAKE2b-256 a09d72ffb9a3fb0140d14947a49ca49d4e8d7636b26b3e74c597d2d762baf3c4

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 122.6 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.9

File hashes

Hashes for mojimoji-0.0.10.dev1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 19a449f4d3ebdcf0ff5d4485d400890450d2170e766c2f78d7c6cceec0ca7855
MD5 dadc688a2aebdbb76bed397d2e7df4ff
BLAKE2b-256 7e500302af43caec72c1aef852ede0dc4fe30d4a96c1a06ec03b6647870bf73d

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.10.dev1-cp35-cp35m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.10.dev1-cp35-cp35m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: CPython 3.5m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.9

File hashes

Hashes for mojimoji-0.0.10.dev1-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a6ea41697427e22b6686435742d4fdfec8846b59ff77b47bde21f1fade1143e4
MD5 3fdfc3193305563347bbd53298bd065d
BLAKE2b-256 dda9b85206e74602107563ead77f0c01c5220f7b2f474bcf97b4164c62936559

See more details on using hashes here.

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