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.11.tar.gz (42.8 kB view details)

Uploaded Source

Built Distributions

mojimoji-0.0.11-cp38-cp38-win_amd64.whl (35.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

mojimoji-0.0.11-cp38-cp38-manylinux1_x86_64.whl (131.3 kB view details)

Uploaded CPython 3.8

mojimoji-0.0.11-cp38-cp38-macosx_10_14_x86_64.whl (41.9 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

mojimoji-0.0.11-cp37-cp37m-win_amd64.whl (35.5 kB view details)

Uploaded CPython 3.7m Windows x86-64

mojimoji-0.0.11-cp37-cp37m-manylinux1_x86_64.whl (127.6 kB view details)

Uploaded CPython 3.7m

mojimoji-0.0.11-cp37-cp37m-macosx_10_14_x86_64.whl (41.5 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

mojimoji-0.0.11-cp36-cp36m-win_amd64.whl (35.5 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

mojimoji-0.0.11-cp36-cp36m-macosx_10_14_x86_64.whl (41.4 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

mojimoji-0.0.11-cp35-cp35m-win_amd64.whl (34.0 kB view details)

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m

mojimoji-0.0.11-cp35-cp35m-macosx_10_14_x86_64.whl (38.4 kB view details)

Uploaded CPython 3.5m macOS 10.14+ x86-64

File details

Details for the file mojimoji-0.0.11.tar.gz.

File metadata

  • Download URL: mojimoji-0.0.11.tar.gz
  • Upload date:
  • Size: 42.8 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.46.0 CPython/3.7.7

File hashes

Hashes for mojimoji-0.0.11.tar.gz
Algorithm Hash digest
SHA256 adef094e1bfd961e40c1fbd2d4664da1be2426d5b31884e27394226af15d50b5
MD5 3b587c43ed7a6bcef9dd72a8b6e41b3e
BLAKE2b-256 04261001e7500bb381a249db3cbfde73bc4479415f936d77cfacda3996660cbe

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 35.9 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.46.0 CPython/3.8.2

File hashes

Hashes for mojimoji-0.0.11-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 304681e2d99db69c552e1e36992cb41b967b46abd1720c1826f9dec678491d56
MD5 6a0728971d749e7e31866d7fe03c149f
BLAKE2b-256 a54582706a6fd40c6b462f5f647a1969d66e46902c54f240f781942954f363b4

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 131.3 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.46.0 CPython/3.8.2

File hashes

Hashes for mojimoji-0.0.11-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ea9c3d0c37ae7a8e494cb9681dae404de4599d4218e5b5d13c009ab1856d6409
MD5 5613684720bf33aadff47386f0775f92
BLAKE2b-256 b84e9c87f0593d3cb89fa5a09a9e2fc2852527d83d6de61979b19fb6657d2372

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: CPython 3.8, macOS 10.14+ 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.46.0 CPython/3.8.2

File hashes

Hashes for mojimoji-0.0.11-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2fb18323ffae39391d77c77b27ed675cbf6e49e10f884ceaf8399be7ca7e0dc5
MD5 e26284e4b2203b9646bbb5fc7982fad8
BLAKE2b-256 67f6648e41c1637eb1d1e728a0463eb9e01a64bbee7fde0654563b279c733877

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 35.5 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.46.0 CPython/3.7.7

File hashes

Hashes for mojimoji-0.0.11-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 029c5d2646c8ab36bef61abe26ed6bc698f7ffb6a744d82fafd86e233d6669a2
MD5 df02b3e93eb57bdf3ebebbbf837a635f
BLAKE2b-256 71518b2665247263eecdd59592a7fdcc8a10db4145c8c70c59690b5a39d9cff8

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 127.6 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.46.0 CPython/3.7.6

File hashes

Hashes for mojimoji-0.0.11-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 642c5e8642fa53c9556cd4c880e09438786dd955c32c7ce5fa2693e16914cdb6
MD5 a8c4fbbe8590b4170d24c3d016580737
BLAKE2b-256 2f8656ae8e75a50c8bbcbfb71efded22f5332a6d710b772b95fd1088bf97bc70

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: CPython 3.7m, macOS 10.14+ 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.46.0 CPython/3.7.7

File hashes

Hashes for mojimoji-0.0.11-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e551bb3be777643e2e1f7bc40db4d57baedaa6dac6c7875d9a926ffe66b67fb1
MD5 cef6ef34222d02109f7f7b6b96f585e8
BLAKE2b-256 bbe4060f6b6268e9a25d48ddd9e9a916a5c344776991a4997c42a4436d107c61

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 35.5 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.46.0 CPython/3.6.8

File hashes

Hashes for mojimoji-0.0.11-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 ae2fcb9fa35f5890ba888780c9d445074717ef988c3171a058f002cd0f3933f4
MD5 80fe930a99e1f3f2dac197dd20cdf301
BLAKE2b-256 2919c432fb07f483bdc2c14561bed50fe27b855d30c4cb43e68c0ada80af655f

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-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.46.0 CPython/3.6.10

File hashes

Hashes for mojimoji-0.0.11-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b7a1fe5726ad7036b096d44e7d014ceac174aec718199e19c6c6d1c2a757f6b9
MD5 ded35c8a5f4ed527bed584290b8450df
BLAKE2b-256 1d0eeb8297652315519ccc0ca3da9e06f0457d87e27f1000f696ca537914856f

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 41.4 kB
  • Tags: CPython 3.6m, macOS 10.14+ 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.46.0 CPython/3.6.10

File hashes

Hashes for mojimoji-0.0.11-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ece991b6529dddb91ae5035dcf3b62b486af675d4ec94fc3ecf7872b66f3df88
MD5 3c54cc7edbcf3cc44a2ca478e46dd021
BLAKE2b-256 a916701a100a258371035e84ea4941d5ebfbc251af745cf62ca213650aa03103

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 34.0 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.46.0 CPython/3.5.4

File hashes

Hashes for mojimoji-0.0.11-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e257176fe55332ac5dc69735270840b36738a82f1dda3383758a6f36b5918fb6
MD5 e03e0b70a1230d9ca110b6905e170bb1
BLAKE2b-256 08ab5c7de432d00e77a5bcf6634443227bb710f2b3c0c7d6f71acf1c77889768

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-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.46.0 CPython/3.5.9

File hashes

Hashes for mojimoji-0.0.11-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3d3756f60754ee95847f419f48246a68271d9024c5296d298054229403804002
MD5 ce528ac06b1d81f0e300076a67481608
BLAKE2b-256 8499c2f8f24457f6328580f68b102b01ad1c2ff6d672c758074cdec97f8a2a70

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.11-cp35-cp35m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.11-cp35-cp35m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: CPython 3.5m, macOS 10.14+ 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.46.0 CPython/3.5.9

File hashes

Hashes for mojimoji-0.0.11-cp35-cp35m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b86ee36240e77a414f796630cf3c80acef4e9528277769d1851d00b94af1cc98
MD5 c35b6814a644307d4c4b36c291a500ff
BLAKE2b-256 960850de5f6fd140888de900679b6f16bb490c2eb5a601f74fbe5fbcd097cc41

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