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

Uploaded Source

Built Distributions

mojimoji-0.0.12-cp39-cp39-win_amd64.whl (34.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

mojimoji-0.0.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (125.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

mojimoji-0.0.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (145.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

mojimoji-0.0.12-cp39-cp39-macosx_10_14_x86_64.whl (40.3 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

mojimoji-0.0.12-cp38-cp38-win_amd64.whl (35.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

mojimoji-0.0.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (128.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

mojimoji-0.0.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (146.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

mojimoji-0.0.12-cp38-cp38-macosx_10_14_x86_64.whl (40.1 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

mojimoji-0.0.12-cp37-cp37m-win_amd64.whl (34.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

mojimoji-0.0.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (125.6 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

mojimoji-0.0.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (140.5 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

mojimoji-0.0.12-cp37-cp37m-macosx_10_14_x86_64.whl (39.7 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

mojimoji-0.0.12-cp36-cp36m-win_amd64.whl (34.5 kB view details)

Uploaded CPython 3.6m Windows x86-64

mojimoji-0.0.12-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124.5 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

mojimoji-0.0.12-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (139.4 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

mojimoji-0.0.12-cp36-cp36m-macosx_10_14_x86_64.whl (39.6 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: mojimoji-0.0.12.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for mojimoji-0.0.12.tar.gz
Algorithm Hash digest
SHA256 01a3d73e8b3c641386b1824d5106b8ea5c351a641623c910d89d8f02520c1b0e
MD5 f06618ce47a8d9cbdcaf2fb2caffce7c
BLAKE2b-256 c8a1debe1812f9d437f65cd58d7990a19815243dbb6b9b132123560b2b9e335a

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: mojimoji-0.0.12-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for mojimoji-0.0.12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b379781a0cb95eeb79939608b4a013ad7b79ba03b7fe9b795eadc40bd96a06c9
MD5 f1b9793200643f15695d1a77ab7d5af0
BLAKE2b-256 f9a2fa5a394d24dad6a85509c2a934348aa188d3c305cce8afdaeb15f1868fa0

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mojimoji-0.0.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 515f6fa5659d77a172f1fb46950d34674f33cf487e9aa131bf9422cbe127e5f4
MD5 1550da6787ade377551eec3da9468d67
BLAKE2b-256 1bb5bbf068592d99f7f646be1ab9954ad3165c28f8874a56a5f9efdfce711f74

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mojimoji-0.0.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b2247233f4b3bee6ab601ac7fcbd84124ad91788a7418c1430f93a4bac340218
MD5 dd680573465cccd8dcc26cfc955fe248
BLAKE2b-256 fecc9bbcae69d29ab3286b862e0646df43b8789f8d37a259eff6804df0c6b110

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mojimoji-0.0.12-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 40.3 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for mojimoji-0.0.12-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ae5e6e8d4e70849f4217fa00ca7d770354f5a13c04778b6f07f3bceb0a636abd
MD5 188edfc8b44c4cb8a884c0706ff63e8e
BLAKE2b-256 3b3bccd068eaff68bd31b1212cdb9076dd929db977f1e47a0c8f980cdcaeadc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mojimoji-0.0.12-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for mojimoji-0.0.12-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8a1285040b7ef7ca5bafe095b62b99507cf19e10c6000e3279bc44d9430da3d9
MD5 258895c08b7fd14daf1610c96169f643
BLAKE2b-256 c3e2c8eff081db2a9fe59b211b3ea99f2cb3484335cae6926ae4ba0bcd54c996

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mojimoji-0.0.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 59cc0af7d3be3b6847c8dcf1a4e0d09cc0646ff64c101308903d14871245403c
MD5 acfa96bcd9a93fc4a928041722e3dc89
BLAKE2b-256 b8b0e46ca48aec4356c77fe0300296e302dd5df118ae7d3daf2f5027195c4576

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mojimoji-0.0.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7a15864d8de07a487280c528fe3d2aeaad05bb2ce6d8bf201fc1480b0b5db337
MD5 430540ef11beb81ac38d4442f926a5e4
BLAKE2b-256 bffd4c7e74abdc5f7ce4724f9bb50e000217814531ee5cbc523694691ac94149

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mojimoji-0.0.12-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for mojimoji-0.0.12-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9723531661911479bbfce08ec8a62c7b5958a307f33a025fe938d19550b13f9d
MD5 340388ec22f8c7ca80365af4f993794f
BLAKE2b-256 9a4eada48b5c3ab089b3ec44877ff19e722db77fbf0e78dff9af0b3e5b1ddb98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mojimoji-0.0.12-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for mojimoji-0.0.12-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f180e2e8ff47e54cc36b0de147bceaf76fab88ef06775835a55b38ef6b82c161
MD5 63b0f3fa30a52687bc3efd7e072fee24
BLAKE2b-256 a9270e03ab9a21f51072fefb5fd8e0191c1fc148e0dfb918d424d3ed921907f5

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mojimoji-0.0.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d974a034528cb9fb95fcade6f3ffb73dc1dc336e17413486a5094724cbe9e34f
MD5 8a70f3bcd3ad6ddc3d0363d4cf31afe5
BLAKE2b-256 a291af710761a256c476e50b1a813f43af6c6b266753eed9e90ec743b7f6c802

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mojimoji-0.0.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b110101148b920eba60fa4627b904fa18801c5ca3667880494b7f0d25dd1a5fe
MD5 7018a959b76dbb5939cac06b2b9c821c
BLAKE2b-256 0f6f88baaad6cd7452026c136bc980a25db125aaf7ee2a2c498b2171ca46318d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mojimoji-0.0.12-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for mojimoji-0.0.12-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a98fb09bd49245f9d9cd29603b912dc2f94e619e6d2f5b722553a5dbe113ce6c
MD5 ff69c1d6490bc30861cd43ae86c6776b
BLAKE2b-256 5bcfc233f4be9a0a41f3fb7229e7509166b07a41b45df049cdf75b70f02823cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mojimoji-0.0.12-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for mojimoji-0.0.12-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 05b589361b6f35aef96df3a7f64c2a286a7e7aed9865cd7baf1a5876bb4cd16a
MD5 b74671356057424c17425568181801b6
BLAKE2b-256 f458152c41b4cdc97e5ea6d0488e471ba3a718ebc925499438fb025e05c3ea9b

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mojimoji-0.0.12-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f7f4da9e809fa68588e817f1ae351c4274be2366e542c51393657cae7bcf114f
MD5 74dc1d1db131ddcfd96304f08907bfae
BLAKE2b-256 3172d6809bd29de7cd208936e1966a4e666159553782d8d29c090d6fa1290375

See more details on using hashes here.

File details

Details for the file mojimoji-0.0.12-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mojimoji-0.0.12-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 61c03620528650603b3c92f367d6db2a645c2638408add5ba03fed982af7cd1d
MD5 fe3aa4451e55bde1cd6ba0fcf8cabebc
BLAKE2b-256 276a01eea01ca30221351c94f33dcbe3b2e1dc7bda7f8075ca0e77567d63eb06

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mojimoji-0.0.12-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for mojimoji-0.0.12-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 98f41bf146b731ed4554c60495c53fd96339a52e02b22a869d6eaf2433047505
MD5 adf194fa8467635cfdb1b72b59942439
BLAKE2b-256 55eb13b3ef01d42eafb10131d79ea0615d48b7dc0a0f1757f71387666895332b

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