1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-wcwidth
7 SDESC[py310]= Measures number of terminal column cells (3.10)
8 SDESC[py311]= Measures number of terminal column cells (3.11)
9 HOMEPAGE= https://github.com/jquast/wcwidth
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/20/f4/c0584a25144ce20bfcf1aecd041768b8c762c1eb0aa77502a3f0baa83f11
14 DISTFILE[1]= wcwidth-0.2.6-py2.py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY310 PY311
20 OPTIONS_STANDARD= none
21 VOPTS[py310]= PY310=ON PY311=OFF
22 VOPTS[py311]= PY310=OFF PY311=ON
24 DISTNAME= wcwidth-0.2.6.dist-info
28 [PY310].USES_ON= python:py310,wheel
30 [PY311].USES_ON= python:py311,wheel
32 [FILE:1433:descriptions/desc.single]
33 |pypi_downloads| |codecov| |license|
39 This library is mainly for CLI programs that carefully produce output for
40 Terminals, or make pretend to be an emulator.
42 **Problem Statement**: The printable length of *most* strings are equal to
44 number of cells they occupy on the screen ``1 character : 1 cell``.
46 there are categories of characters that *occupy 2 cells* (full-wide), and
47 others that *occupy 0* cells (zero-width).
49 **Solution**: POSIX.1-2001 and POSIX.1-2008 conforming systems provide
50 `wcwidth(3)`_ and `wcswidth(3)`_ C functions of which this python module's
51 functions precisely copy. *These functions return the number of cells a
52 unicode string is expected to occupy.*
57 The stable version of this package is maintained on pypi, install using
65 **Problem**: given the following phrase (Japanese),
69 Python **incorrectly** uses the *string length* of 5 codepoints rather than
71 *printible length* of 10 cells, so that when using the `rjust` function,
73 output length is wrong::
75 >>> print(len('コンニチハ'))
78 >>> print('コンニチハ'.rjust(20, '_'))
81 By defining our own "rjust" function that uses wcwidth, we can correct
84 >>> def wc_rjust(text, length, padding=' '):
89 795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e 29995 wcwidth-0.2.6-py2.py3-none-any.whl