Python bindings for wc(s)width
Project description
Python bindings for wc(s)width
cwcwidth
provides Python bindings for wcwidth
and wcswidth
functions defined in POSIX.1-2001
and POSIX.1-2008 based on Cython. These functions compute the printable
length of a unicode character/string on a terminal. The module provides the same functions as
wcwidth and its behavior is compatible.
On systems not conforming to POSIX.1-2001 and POSIX.1-2008, Markus Kuhn's implementation is used to provide the functionality.
Dependencies
Cython >= 0.28
(optional, only for building). If Cython is not available, the C files are not regenerated from their source.
Quick installation guide
cwcwidth
can be installed via pip
:
pip install cwcwidth
or by running:
python3 setup.py install
Usage
import cwcwidth
cwcwidth.wcwidth("a") # 1
cwcwidth.wcswidth("コ") # 2
cwcwidth.wcswidth("コンニチハ, セカイ!") # 19
Comparison with wcwidth
>>> import wcwidth, cwcwidth, timeit
>>> timeit.timeit(lambda: wcwidth.wcswidth("コンニチハ, セカイ!"))
19.14463168097427
>>> timeit.timeit(lambda: cwcwidth.wcswidth("コンニチハ, セカイ!"))
0.16294104099506512
License
The code is licensed under the Expat license.
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
cwcwidth-0.1.2.tar.gz
(35.4 kB
view hashes)
Built Distributions
Close
Hashes for cwcwidth-0.1.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d753e5bb7da61038c912dae91abcb02aeef7a8fa2c48ed9b2fb6739cc013d0ed |
|
MD5 | 53df3fa2cf80b6ca2b5ba5e5986bb3a7 |
|
BLAKE2b-256 | d232887d2b9d5c42445a9f0383ca547fc50e83311ad3f0e345cf52413edacb02 |
Close
Hashes for cwcwidth-0.1.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a16afea349abba714cf9b6bb42e4a66d2b0917813d5ce6db1baed2f9e1557ed |
|
MD5 | 3cd765274a84ae138e7eb0d490c7bb28 |
|
BLAKE2b-256 | 81c7f895d66f2a7e5b097e8cc293e20bd47dd3d214cb2a21fc7c35d17b3e771b |
Close
Hashes for cwcwidth-0.1.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2722e94e1bf579a0856d399a6bdb6d4fb07dbd8a683838ca6e4e25e289a66a38 |
|
MD5 | 914adc789a8a3e69de03894b94d787e1 |
|
BLAKE2b-256 | 40734acb68ed191642147d043f56971301d9d6e8f7ac23163e0fe39b6e703257 |
Close
Hashes for cwcwidth-0.1.2-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afc4fa179c4ae769282bb5a0ee2ce3cee7a307a40f7e6ff5395e07ac824c2080 |
|
MD5 | 484659cb42a5ae54e3565a3ac4c1a127 |
|
BLAKE2b-256 | a15f7610c58f72f8fb77f63aa2e98fffbc17c8590f70e984b7406a54732003c2 |
Close
Hashes for cwcwidth-0.1.2-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c9bfb9dc7b5ee742ab5394686c8b6db820b453e60f57a1cc35bdac25ede98a |
|
MD5 | 4f1c82afa233428d8d1e1893ed373ada |
|
BLAKE2b-256 | c9382fa5d63d8fcdf4d7a38bdacb9936bbfc75fc4e071fc471ee5deabe3873be |
Close
Hashes for cwcwidth-0.1.2-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9253d6ea2bf7eef90134ee58b771f4e9f5114d5f4108c26e3e7c1cefae11863b |
|
MD5 | 0cff2a5d05fe6d81be48897e761780c3 |
|
BLAKE2b-256 | 42354744b8ba16120e120c8ef9333abe393681fe5875f882ed2d375e454e9ab9 |
Close
Hashes for cwcwidth-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5854e7c62bd0cd3962eb6de662f8df30f82300f3f7d7a0b77b75cc6f2f294a2a |
|
MD5 | 7aff60c5b3501b0eed9dd48a0689fff4 |
|
BLAKE2b-256 | a8049aa80021092e4fd201cfcb9a5421e01784a94b663619c81525bc44ba786a |
Close
Hashes for cwcwidth-0.1.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e453ea7282b209af887e275a3aea6efc1ce4295c0465d3598045473ea1b3ac8 |
|
MD5 | 45ae5b3e5db1b9c72a2886c45a4dae5b |
|
BLAKE2b-256 | 3f8136fb3bbad5fc62c6d995345780fa921473bf2b185dcf5e9ff6afcdeb0576 |
Close
Hashes for cwcwidth-0.1.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86158fb6060fd2091754a4831eb311f679ae50100df2fe6ed45193e3103f9db1 |
|
MD5 | d3ebcda5f6c28c261ed8051d15c6629f |
|
BLAKE2b-256 | 387749a767459cc286d0953b5a50909461b6342184d8521612f1c5551fa59b44 |
Close
Hashes for cwcwidth-0.1.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e81f5b0a972c828b2a30f101e398ddb96a5e70430752e2992a00fe26163038f5 |
|
MD5 | c5d2c2b9ef1826b47ad26d5ee557b246 |
|
BLAKE2b-256 | 327bf84508d8c77384f24abf2c899bf4c4e660fde87addf8b4cdaa6b7b582fb0 |
Close
Hashes for cwcwidth-0.1.2-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fdaca6c96b0f2f43267489153778fcfd763bcdfae99b41aff88bd1e823fb032 |
|
MD5 | 22941b46f82e2eff7ad577bf235b94db |
|
BLAKE2b-256 | 099845e37dd9f5dabc4273aaa27da9b9c249eaa5dc05bca289fbfa739878dd22 |
Close
Hashes for cwcwidth-0.1.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc3fd6a6ff517fed4a6e35ec8985940738284a625b916ccc0d60e4d103c28a27 |
|
MD5 | bf8430465fd53c4452aa39008d10d1aa |
|
BLAKE2b-256 | e150e15f9c23cdf69fcfe8465e8e0bcd8567a7d56e06bed47c4668efb9552617 |
Close
Hashes for cwcwidth-0.1.2-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6a40d778a6b6838ff4288b1860f80a35481a9e14d1d20180f08cebf22c36370 |
|
MD5 | ffd03e74742f065d6ee4b08de56c6d4b |
|
BLAKE2b-256 | 5c757d3cfde3a6f7b94c866cd33f8994406de64be0f25adf59c97d1e53a974a6 |
Close
Hashes for cwcwidth-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1684ba81edfbcd083e864c68cd35b9baf165e6e4dc288e6441141abc6ce9667 |
|
MD5 | b27c1201d6b11b57df4898fa7234447e |
|
BLAKE2b-256 | fa4c409bc3cd1196bf1e708aeb19a8fbf5b9a417702d250a982aab0e29eef6f0 |
Close
Hashes for cwcwidth-0.1.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c58046a26719e3eef943b0eb09408d10fc896bda4b867c86b3642c8e5effffc2 |
|
MD5 | 44c539d0c5d0bf57344eb82c6a1188af |
|
BLAKE2b-256 | 9435e6c955456f76107f905113d7de807571abee145f1cf3a2aa148bf2df6db1 |
Close
Hashes for cwcwidth-0.1.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6ae7382cdbf1bcb8c7f30b04c70ce4a794b63145840ba7441b79f5a5f751cd7 |
|
MD5 | a55808ffee11d1990356332d6837b9e6 |
|
BLAKE2b-256 | 7988b3e455c67b763681af380780976cd5224e903fb1d2ae9c4e8392b2868ebe |
Close
Hashes for cwcwidth-0.1.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57be6edc9273bf298d0c371f8cbab55d5a556135d1733db620f518a25aa00ecf |
|
MD5 | 0af13e29431c96d7c8088071d7a9510b |
|
BLAKE2b-256 | 01e9b4d5342631fb965744c5695d4afaecceb8d525ed7554367744af01588c27 |
Close
Hashes for cwcwidth-0.1.2-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ae976f5911c05146d3e55dd60a9e87da694ea2fbda9314a40280ff27e53b8f2 |
|
MD5 | 8a718f7aae3023a2ed8d48d111510688 |
|
BLAKE2b-256 | cf4cecf79f475b13951e96055a13a69130a1b53e84e29098862e5c668786f8da |
Close
Hashes for cwcwidth-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0da4dca360c273e20c1ab031cb6f319baec60f9f70e6c7e7849c3d4d65ace34 |
|
MD5 | cae7a76506196e5589005c237c833cb3 |
|
BLAKE2b-256 | baf2a96f92456eb45d769f2c4243c51e8518f63e1611a544129a40e3c3f69255 |
Close
Hashes for cwcwidth-0.1.2-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a412d5504b7808bc1256c06659475d763594dbfdbd1d8b54e85403424a18e025 |
|
MD5 | d88ad4e06819ad4ade7d0e899add503a |
|
BLAKE2b-256 | 60b8d73d45f12ee1495da6d5431894192cb37fd42df1b9c8705cbadf3779ac64 |
Close
Hashes for cwcwidth-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef66a357834110b9a17a481cfb4562996fc8e832c633c67cfb3617e17407a2ad |
|
MD5 | dc0ab6cf6668c8aaedd4283f233b06e4 |
|
BLAKE2b-256 | 3e079434258c2949d66cca8dfec303a1fb9aeeb13157a32e03d3788e91ad73ac |
Close
Hashes for cwcwidth-0.1.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f77e297f7df7d797d50df58c612e1838023cd83f6dbfc1c6f8b146ef87fc9cfd |
|
MD5 | 9d252a55fcbadcc643f998c9a99448b5 |
|
BLAKE2b-256 | 03b9171d74513765b52f8ed4b8f7246f45791c5f3b698620411d4f3ff5db13a8 |
Close
Hashes for cwcwidth-0.1.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86b81629e7c74830e90db6d058790d557500f3fc7ced31241a9717f1aeb1c7f1 |
|
MD5 | d8b6a3a97c6d21e1d76c7c673db818b0 |
|
BLAKE2b-256 | 74c66bd491256175a891b68719fee0e30ad26dc5f3130ef9b4c12ceac70d624d |
Close
Hashes for cwcwidth-0.1.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14ff60534b2a58d2c8708fcd3c763809b9ecab0ed5992bf6676f7d1d8e4731ea |
|
MD5 | abda7130320fe7efe8593ebd3b2ffbfa |
|
BLAKE2b-256 | 717d731de9c80f34bb31a8d92ff4aae3b241c38045f4ff57c6050becfa6f7a4e |
Close
Hashes for cwcwidth-0.1.2-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b74b5fb63a1b2172c24d229a5317be08901f84b4692ca036de4e11219f72c17 |
|
MD5 | f33d2ffe80ec019178f1ddc162436d2c |
|
BLAKE2b-256 | 59b3401ed371fa84135723a70eb71f8c523c5105d48b376830017466924ec858 |
Close
Hashes for cwcwidth-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d98c16a97bc88d03acc8d1b895a492048efd43b0d687fa0f537ff5e753a4d1b |
|
MD5 | 55107241febb155f47e717aae3982fbb |
|
BLAKE2b-256 | 23027cddb2dee19c65e2dfa518d737cacd5a5a0b98d1fd64e9fb09a990a2f206 |
Close
Hashes for cwcwidth-0.1.2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c1e4014fb2607c36ffac47341ff7d696adfad1b2f39c565850bf0eb08952695 |
|
MD5 | 0f099caac132aea34b952868a7512d31 |
|
BLAKE2b-256 | e94f59dac52a3dc35a7c50d124caeeb29c92e198a35112c09dc43b609fa615cb |
Close
Hashes for cwcwidth-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 043642a199463e29d682d5c1f70c9c7a84eddfafa4e08557d08f680d38b7822f |
|
MD5 | 3eac1d7b18a90b702c2ee3bf78121c40 |
|
BLAKE2b-256 | f5b1c34f2a12387030cd2535b0de85f4b8ea46c4b1f1560900e38541bea4d90f |