Ravenports generated: 21 Sep 2021 23:49
[ravenports.git] / bucket_93 / python-wcwidth
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-wcwidth
4 VERSION=                0.2.5
5 KEYWORDS=               python
6 VARIANTS=               py38 py39
7 SDESC[py38]=            Measures number of terminal column cells (PY38)
8 SDESC[py39]=            Measures number of terminal column cells (PY39)
9 HOMEPAGE=               https://github.com/jquast/wcwidth
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/59/7c/e39aca596badaf1b78e8f547c807b04dae603a433d3e7a7e04d67f2ef3e5
14 DISTFILE[1]=            wcwidth-0.2.5-py2.py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[py38]=            single
17 SPKGS[py39]=            single
18
19 OPTIONS_AVAILABLE=      PY38 PY39
20 OPTIONS_STANDARD=       none
21 VOPTS[py38]=            PY38=ON PY39=OFF
22 VOPTS[py39]=            PY38=OFF PY39=ON
23
24 DISTNAME=               wcwidth-0.2.5.dist-info
25
26 GENERATED=              yes
27
28 [PY38].USES_ON=                         python:py38,wheel
29
30 [PY39].USES_ON=                         python:py39,wheel
31
32 [FILE:1422:descriptions/desc.single]
33 |pypi_downloads| |codecov| |license|
34
35 ============
36 Introduction
37 ============
38
39 This library is mainly for CLI programs that carefully produce output for
40 Terminals, or make pretend to be an emulator.
41
42 **Problem Statement**: The printable length of *most* strings are equal to
43 the
44 number of cells they occupy on the screen ``1 charater : 1 cell``. 
45 However,
46 there are categories of characters that *occupy 2 cells* (full-wide), and
47 others that *occupy 0* cells (zero-width).
48
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.*
53
54 Installation
55 ------------
56
57 The stable version of this package is maintained on pypi, install using
58 pip::
59
60     pip install wcwidth
61
62 Example
63 -------
64
65 **Problem**: given the following phrase (Japanese),
66
67    >>>  text = u'コンニチハ'
68
69 Python **incorrectly** uses the *string length* of 5 codepoints rather than
70 the
71 *printible length* of 10 cells, so that when using the `rjust` function,
72 the
73 output length is wrong::
74
75     >>> print(len('コンニチハ'))
76     5
77
78     >>> print('コンニチハ'.rjust(20, '_'))
79     _____コンニチハ
80
81 By defining our own "rjust" function that uses wcwidth, we can correct
82 this::
83
84    >>> def wc_rjust(text, length, padding=' '):
85        :alt: MIT License
86
87
88 [FILE:113:distinfo]
89 beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784        30763 wcwidth-0.2.5-py2.py3-none-any.whl
90