A fast converter between Japanese hankaku and zenkaku characters
Project description
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
mojimoji: 0.0.1
zenhan: 0.4
unicodedata: Bundled with Python 2.7.3
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file mojimoji-0.0.10.tar.gz
.
File metadata
- Download URL: mojimoji-0.0.10.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a888fc1f9ce8e578cde65c06689e41a941e4c04b82504ad596e7f2207c69f91 |
|
MD5 | f75eee980e98b7e15334469b85abe3d5 |
|
BLAKE2b-256 | 6a92ee6c4ca0791f39fdc923e44dff7a6421108ffdff9c75f59687389672d4ed |
File details
Details for the file mojimoji-0.0.10-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38d4d8f7d0cb13e4ee20aacb5bfe62cd1d6a42365c5dad7bbf28c0121c2f063d |
|
MD5 | 3a73090ca4a0697cc9917029bbef8524 |
|
BLAKE2b-256 | 84060fff826752c399005ec7d26e8e501e2fac9d9b19a7c7d6a1086de8096dc8 |
File details
Details for the file mojimoji-0.0.10-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a76ade82c9e70e3ab73574d299fa9304ed718ea8d845f455782ab2ad2d60a45 |
|
MD5 | 6ca7b1381a76ba182e9afe7cb3ee1815 |
|
BLAKE2b-256 | 5aed8f95adbde906e1528813499601cf0c1cfe1f0ac06dd0358bf478a6bfff38 |
File details
Details for the file mojimoji-0.0.10-cp38-cp38-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-cp38-cp38-macosx_10_13_x86_64.whl
- Upload date:
- Size: 41.6 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a3e050ebd79863a02e08a4a0cada3b1df5dc70995f093ebabea22cb01ceb89a |
|
MD5 | a2c04dd6214d268843b5a88b1eadd0bf |
|
BLAKE2b-256 | d4a9a497a1121d7c4a37fd66225443632d176e60eb5e66e6c66746f96b82e6a3 |
File details
Details for the file mojimoji-0.0.10-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 35.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36fced765d03c9aeb65a4e8f346c0cb5d19ebd6b91cbf526b2ba5991d94faf17 |
|
MD5 | 9020c5d6991d464b5470f89945741903 |
|
BLAKE2b-256 | 79638361e7688c4f847980d5f7454d6dccc67c5cd3f1dde7ae4a45ddee0d542a |
File details
Details for the file mojimoji-0.0.10-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cbebe477e3e52d78dee6454be1bf77adafd6cb58b8c0ac478c28778076e3de2 |
|
MD5 | 3c31f3d6b245ad389a89059e3e356633 |
|
BLAKE2b-256 | 1c40c69e06b7b538053f3aff232304ed8cee3865c6116e9f09435223071f5a40 |
File details
Details for the file mojimoji-0.0.10-cp37-cp37m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18081ce1690dc7ca0c37c750c8d9344f13cd5cc9736928e5f75d28d955abaa43 |
|
MD5 | 6f9ffee811f2a8f365b717b870f53163 |
|
BLAKE2b-256 | d707a4e372947da34114e3809a00eaed03a05c0c7a01a39aba335e3abd620106 |
File details
Details for the file mojimoji-0.0.10-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fecacb7daee2b3fc55a2ca208caff2569347c0f3a943573578e40815b4d1c290 |
|
MD5 | 4a58c96e77969cd2ed9597f50596ad92 |
|
BLAKE2b-256 | d02ec3a47ee80993a887888c749ac085791d927e7eb5151ef71f650840508e85 |
File details
Details for the file mojimoji-0.0.10-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | af5d651e88c4fba559cd6f5b8022883a4af0a07148f9ea27de00fa1c6fb66e63 |
|
MD5 | 60936b16c1df2a9166612bb1b4356add |
|
BLAKE2b-256 | 652421fff7ab1d69b20e32ae75742bea606df7d88ddf46d05880318e33b8cf57 |
File details
Details for the file mojimoji-0.0.10-cp36-cp36m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75a6850a3710b2bfea8ae93a136ae3e8e0daca474d83946a885080b24ac245de |
|
MD5 | ca456d6d2021bd8fd428daacf51fea01 |
|
BLAKE2b-256 | a47ba11d622b2bea488b54d6e9587b7799413625108b776c07ed1fc17ed6f0fc |
File details
Details for the file mojimoji-0.0.10-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 33.7 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ade646beecee60e2f37662654a81285121a920535faeb5a6bc9edcb8eeec345 |
|
MD5 | 882a2e6f5208afa609149d59afbc11c2 |
|
BLAKE2b-256 | a775670795f3406d415b15c0f19bfca5a8c4e39c586b055ecff3deabce69e27b |
File details
Details for the file mojimoji-0.0.10-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33496206725ee7ede340e86c7b3697e73bdffc6c22c76f6b85a7df320ef42827 |
|
MD5 | 65d433e8135e2f9f397920783c58a0e3 |
|
BLAKE2b-256 | 550d9b53d6abf32d259843ec5549ab23a684642c85b87143c80556807ad6b76f |
File details
Details for the file mojimoji-0.0.10-cp35-cp35m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: mojimoji-0.0.10-cp35-cp35m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 38.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b0612d595d54f0d644fc08579b47f35993c87f71fea444712a3bc29ce58ae20 |
|
MD5 | b86c3693432859a8329fdf1b42d0ec7a |
|
BLAKE2b-256 | 16a47bbd19e033397a7945b3a5f51ad4e3a848c963f26b097a4cb3dc6910699d |