{ "info": { "author": "Jeff Quast", "author_email": "contact@jeffquast.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: POSIX", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Internationalization", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Localization", "Topic :: Terminals" ], "description": ".. image:: https://img.shields.io/travis/jquast/wcwidth.svg\n :target: https://travis-ci.org/jquast/wcwidth\n :alt: Travis Continous Integration\n\n.. image:: https://img.shields.io/coveralls/jquast/wcwidth.svg\n :target: https://coveralls.io/r/jquast/wcwidth\n :alt: Coveralls Code Coverage\n\n.. image:: https://img.shields.io/pypi/v/wcwidth.svg\n :target: https://pypi.python.org/pypi/wcwidth/\n :alt: Latest Version\n\n.. image:: https://img.shields.io/github/license/jquast/wcwidth.svg\n :target: https://pypi.python.org/pypi/wcwidth/\n :alt: License\n\n.. image:: https://img.shields.io/pypi/wheel/wcwidth.svg\n :alt: Wheel Status\n\n.. image:: https://img.shields.io/pypi/dm/wcwidth.svg\n :target: https://pypi.python.org/pypi/wcwidth/\n :alt: Downloads\n\n============\nIntroduction\n============\n\nThis Library is mainly for those implementing a Terminal Emulator, or programs\nthat carefully produce output to be interpreted by one.\n\n**Problem Statement**: When printed to the screen, the length of the string is\nusually equal to the number of cells it occupies. However, there are\ncategories of characters that occupy 2 cells (full-wide), and others that\noccupy 0.\n\n\n**Solution**: POSIX.1-2001 and POSIX.1-2008 conforming systems provide\n`wcwidth(3)`_ and `wcswidth(3)`_ C functions of which this python module's\nfunctions precisely copy. *These functions return the number of cells a\nunicode string is expected to occupy.*\n\nThis library aims to be forward-looking, portable, and most correct. The most\ncurrent release of this API is based on the Unicode Standard release files:\n\n``DerivedGeneralCategory-9.0.0.txt``\n *Date: 2016-06-01, 10:34:26 GMT*\n \u00a9 2016 Unicode\u00ae, Inc.\n\n``EastAsianWidth-9.0.0.txt``\n *Date: 2016-05-27, 17:00:00 GMT [KW, LI]*\n \u00a9 2016 Unicode\u00ae, Inc.\n\n\nInstallation\n------------\n\nThe stable version of this package is maintained on pypi, install using pip::\n\n pip install wcwidth\n\nExample\n-------\n\nTo Display ``u'\u30b3\u30f3\u30cb\u30c1\u30cf'`` right-adjusted on screen of 80 columns::\n\n >>> from wcwidth import wcswidth\n >>> text = u'\u30b3\u30f3\u30cb\u30c1\u30cf'\n >>> text_len = wcswidth(text)\n >>> print(u' ' * (80 - text_len) + text)\n\nwcwidth, wcswidth\n-----------------\nUse function ``wcwidth()`` to determine the length of a *single unicode\ncharacter*, and ``wcswidth()`` to determine the length of a several, or a\n*string of unicode characters*.\n\nBriefly, return values of function ``wcwidth()`` are:\n\n``-1``\n Indeterminate (not printable).\n\n``0``\n Does not advance the cursor, such as NULL or Combining.\n\n``2``\n Characters of category East Asian Wide (W) or East Asian\n Full-width (F) which are displayed using two terminal cells.\n\n``1``\n All others.\n\nFunction ``wcswidth()`` simply returns the sum of all values for each character\nalong a string, or ``-1`` when it occurs anywhere along a string.\n\nMore documentation is available using pydoc::\n\n $ pydoc wcwidth\n\n=======\nCaveats\n=======\n\nThis library attempts to determine the printable width by an unknown targeted\nterminal emulator. It does not provide any ability to discern what the target\nemulator software, version, of level of support is. Results may vary!\n\nA `crude method\n`_\nof determining the level of unicode support by the target emulator may be\nperformed using the VT100 Query Cursor Position sequence.\n\nThe libc version of `wcwidth(3)`_ is often several unicode releases behind,\nand therefor several levels of support lower than this python library. You\nmay determine an exacting list of these discrepancies using the project\nfile `wcwidth-libc-comparator.py\n`_.\n\n\n==========\nDeveloping\n==========\n\nInstall wcwidth in editable mode::\n\n pip install -e.\n\nInstall developer requirements::\n\n pip install -r requirements-develop.txt\n\nExecute unit tests using tox::\n\n tox\n\nUpdating Tables\n---------------\n\nThe command ``python setup.py update`` will fetch the following resources:\n\n- http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt\n- http://www.unicode.org/Public/UNIDATA/extracted/DerivedGeneralCategory.txt\n\nAnd generates the table files:\n\n- `wcwidth/table_wide.py `_\n- `wcwidth/table_zero.py `_\n\nUses\n----\n\nThis library is used in:\n\n- `jquast/blessed`_, a simplified wrapper around curses.\n\n- `jonathanslenders/python-prompt-toolkit`_, a Library for building powerful\n interactive command lines in Python.\n\nAdditional tools for displaying and testing wcwidth are found in the `bin/\n`_ folder of this project's\nsource code. They are not distributed.\n\n=======\nHistory\n=======\n\n0.1.7 *2016-07-01*\n * **Updated** tables to Unicode Specification 9.0.0. (`PR #18`_).\n\n0.1.6 *2016-01-08 Production/Stable*\n * ``LICENSE`` file now included with distribution.\n\n0.1.5 *2015-09-13 Alpha*\n * **Bugfix**:\n Resolution of \"combining_ character width\" issue, most especially\n those that previously returned -1 now often (correctly) return 0.\n resolved by `Philip Craig`_ via `PR #11`_.\n * **Deprecated**:\n The module path ``wcwidth.table_comb`` is no longer available,\n it has been superseded by module path ``wcwidth.table_zero``.\n\n0.1.4 *2014-11-20 Pre-Alpha*\n * **Feature**: ``wcswidth()`` now determines printable length\n for (most) combining_ characters. The developer's tool\n `bin/wcwidth-browser.py`_ is improved to display combining_\n characters when provided the ``--combining`` option\n (`Thomas Ballinger`_ and `Leta Montopoli`_ `PR #5`_).\n * **Feature**: added static analysis (prospector_) to testing\n framework.\n\n0.1.3 *2014-10-29 Pre-Alpha*\n * **Bugfix**: 2nd parameter of wcswidth was not honored.\n (`Thomas Ballinger`_, `PR #4`_).\n\n0.1.2 *2014-10-28 Pre-Alpha*\n * **Updated** tables to Unicode Specification 7.0.0.\n (`Thomas Ballinger`_, `PR #3`_).\n\n0.1.1 *2014-05-14 Pre-Alpha*\n * Initial release to pypi, Based on Unicode Specification 6.3.0\n\nThis code was originally derived directly from C code of the same name,\nwhose latest version is available at\nhttp://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c::\n\n * Markus Kuhn -- 2007-05-26 (Unicode 5.0)\n *\n * Permission to use, copy, modify, and distribute this software\n * for any purpose and without fee is hereby granted. The author\n * disclaims all warranties with regard to this software.\n\n.. _`prospector`: https://github.com/landscapeio/prospector\n.. _`combining`: https://en.wikipedia.org/wiki/Combining_character\n.. _`bin/wcwidth-browser.py`: https://github.com/jquast/wcwidth/tree/master/bin/wcwidth-browser.py\n.. _`Thomas Ballinger`: https://github.com/thomasballinger\n.. _`Leta Montopoli`: https://github.com/lmontopo\n.. _`Philip Craig`: https://github.com/philipc\n.. _`PR #3`: https://github.com/jquast/wcwidth/pull/3\n.. _`PR #4`: https://github.com/jquast/wcwidth/pull/4\n.. _`PR #5`: https://github.com/jquast/wcwidth/pull/5\n.. _`PR #11`: https://github.com/jquast/wcwidth/pull/11\n.. _`PR #18`: https://github.com/jquast/wcwidth/pull/18\n.. _`jquast/blessed`: https://github.com/jquast/blessed\n.. _`jonathanslenders/python-prompt-toolkit`: https://github.com/jonathanslenders/python-prompt-toolkit\n.. _`wcwidth(3)`: http://man7.org/linux/man-pages/man3/wcwidth.3.html\n.. _`wcswidth(3)`: http://man7.org/linux/man-pages/man3/wcswidth.3.html", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jquast/wcwidth", "keywords": "terminal,emulator,wcwidth,wcswidth,cjk,combining,xterm,console", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "wcwidth", "package_url": "https://pypi.org/project/wcwidth/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/wcwidth/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jquast/wcwidth" }, "release_url": "https://pypi.org/project/wcwidth/0.1.7/", "requires_dist": null, "requires_python": null, "summary": "Measures number of Terminal column cells of wide-character codes", "version": "0.1.7" }, "last_serial": 2199690, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0fd1ab9ad1d2021545dd4ef12da67fc0", "sha256": "7e6f252e18af0d6fde002502e0fc4b83feaf0150d4bcc976c8b7f4fc1f57c84e" }, "downloads": -1, "filename": "wcwidth-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0fd1ab9ad1d2021545dd4ef12da67fc0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15875, "upload_time": "2014-05-05T02:00:07", "url": "https://files.pythonhosted.org/packages/1e/87/432c601218773d2dd202e5b8bf80ff457586974e566992869fadb7092ca1/wcwidth-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "91ba55b2a4352c0b64e4cb3a7c711146", "sha256": "d12d0f7ff79c68a4579928f52047bd5103c1b7ce0688b2848bb1998ea0c6011d" }, "downloads": -1, "filename": "wcwidth-0.1.0.tar.gz", "has_sig": false, "md5_digest": "91ba55b2a4352c0b64e4cb3a7c711146", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16151, "upload_time": "2014-05-05T02:19:13", "url": "https://files.pythonhosted.org/packages/9d/b6/06ed83b4075fa4d93037716e8aafb59bc424161907ccf3080cede18b68eb/wcwidth-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "073c52a65998eac6758db42878872d3e", "sha256": "019b71c91209e44c50a2cc97f50a60ed9bc35ca37b6f3f8fe3a6fdaafe58fc55" }, "downloads": -1, "filename": "wcwidth-0.1.1.tar.gz", "has_sig": false, "md5_digest": "073c52a65998eac6758db42878872d3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16349, "upload_time": "2014-07-01T01:29:09", "url": "https://files.pythonhosted.org/packages/8d/e9/8e75232e75ff0fd1cfcb1af7a48467866d6cf8b845ff72b0c3e3e53f6019/wcwidth-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6e918df787498d3380ab07ca183739fa", "sha256": "15aebf110eb927cff11d7147bb44cdda927687f06bc90e734f8dd51e74924451" }, "downloads": -1, "filename": "wcwidth-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6e918df787498d3380ab07ca183739fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16883, "upload_time": "2014-10-28T20:37:42", "url": "https://files.pythonhosted.org/packages/43/cf/cbebb348464a6a37185dd879684c36cce94b28cf1034f72705c5237fdd75/wcwidth-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "7c6ec21582096cd45050d169980e97a6", "sha256": "9a60bcd4f9d3fdeb91bd1d24e5d3e9b56a4fba2f0e629c0bb8c760e873a956f8" }, "downloads": -1, "filename": "wcwidth-0.1.3.tar.gz", "has_sig": false, "md5_digest": "7c6ec21582096cd45050d169980e97a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17190, "upload_time": "2014-10-29T16:45:01", "url": "https://files.pythonhosted.org/packages/c6/89/d0ba712b61b2df03789d59527b3dbc9ada2c406bf2d12a718488269d13df/wcwidth-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "01a6d0ae344d4cf2acf3de91dd6969d2", "sha256": "c512afcc50c2c0c74c9fb26c0443d686c376c9a4551be969040bfdb390b077b0" }, "downloads": -1, "filename": "wcwidth-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "01a6d0ae344d4cf2acf3de91dd6969d2", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 20751, "upload_time": "2014-11-20T19:08:52", "url": "https://files.pythonhosted.org/packages/f4/d2/59d085488e7ed8b4939de0ad6ed371b351aff557ef0d797c80e8c39735d6/wcwidth-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4fb1d2481c5a849e57ad3fa7018ccbae", "sha256": "906d3123045d77027b49fe912458e1a1e1d6ca1a51558a4bd9168d143b129d2b" }, "downloads": -1, "filename": "wcwidth-0.1.4.tar.gz", "has_sig": false, "md5_digest": "4fb1d2481c5a849e57ad3fa7018ccbae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19584, "upload_time": "2014-11-20T19:08:48", "url": "https://files.pythonhosted.org/packages/16/c8/62ccd24e17b37a363e53190474a8fcd616903eb6e61afd42a874b187f167/wcwidth-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "5b5b63d7d665feb56caedfa4f1032760", "sha256": "edcb215f9cf144b1250787061a7b06cd84872b8b40f2a824c8cee1549e7bb472" }, "downloads": -1, "filename": "wcwidth-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5b5b63d7d665feb56caedfa4f1032760", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 18884, "upload_time": "2015-09-14T06:25:51", "url": "https://files.pythonhosted.org/packages/8b/30/f46badba94cedcd5ceb5918a7c5a34f3a1b9e902e045b7d8d39c1db3d99a/wcwidth-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2282d853074f2f1f465a3387e524d99b", "sha256": "66c7ce3199c87833aaaa1fe1241b63261ce53c1062597c189a16a54713e0919d" }, "downloads": -1, "filename": "wcwidth-0.1.5.tar.gz", "has_sig": false, "md5_digest": "2282d853074f2f1f465a3387e524d99b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19553, "upload_time": "2015-09-14T06:25:47", "url": "https://files.pythonhosted.org/packages/b2/40/8a8223c30a0dd6af088c4785d6bed0a044091655ba20cce8154e4ee4967f/wcwidth-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "4552a9b78a84730b781d14c07264da19", "sha256": "ee6caad8dedc21dcab9fdda0125d2520ce49a8c90dd2c7930f8c591ab9f66900" }, "downloads": -1, "filename": "wcwidth-0.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4552a9b78a84730b781d14c07264da19", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 19296, "upload_time": "2016-01-08T21:34:38", "url": "https://files.pythonhosted.org/packages/90/c8/d28358bffe21c93691cf90bb7231d9c7bb9686afb9fd8c84b7866a2a1004/wcwidth-0.1.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "53031c6d6490d65c1de601595cff835f", "sha256": "dcb3ec4771066cc15cf6aab5d5c4a499a5f01c677ff5aeb46cf20500dccd920b" }, "downloads": -1, "filename": "wcwidth-0.1.6.tar.gz", "has_sig": false, "md5_digest": "53031c6d6490d65c1de601595cff835f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20483, "upload_time": "2016-01-08T21:34:31", "url": "https://files.pythonhosted.org/packages/c2/d1/7689293086a8d5320025080cde0e3155b94ae0a7496fb89a3fbaa92c354a/wcwidth-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "9fb9f073e3560424296f3f2c745beac3", "sha256": "f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" }, "downloads": -1, "filename": "wcwidth-0.1.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9fb9f073e3560424296f3f2c745beac3", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 21014, "upload_time": "2016-07-02T16:42:09", "url": "https://files.pythonhosted.org/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3b6a0a08f0c8a34d1de8cf44150a4ad", "sha256": "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e" }, "downloads": -1, "filename": "wcwidth-0.1.7.tar.gz", "has_sig": false, "md5_digest": "b3b6a0a08f0c8a34d1de8cf44150a4ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22884, "upload_time": "2016-07-02T16:42:04", "url": "https://files.pythonhosted.org/packages/55/11/e4a2bb08bb450fdbd42cc709dd40de4ed2c472cf0ccb9e64af22279c5495/wcwidth-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9fb9f073e3560424296f3f2c745beac3", "sha256": "f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" }, "downloads": -1, "filename": "wcwidth-0.1.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9fb9f073e3560424296f3f2c745beac3", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 21014, "upload_time": "2016-07-02T16:42:09", "url": "https://files.pythonhosted.org/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3b6a0a08f0c8a34d1de8cf44150a4ad", "sha256": "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e" }, "downloads": -1, "filename": "wcwidth-0.1.7.tar.gz", "has_sig": false, "md5_digest": "b3b6a0a08f0c8a34d1de8cf44150a4ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22884, "upload_time": "2016-07-02T16:42:04", "url": "https://files.pythonhosted.org/packages/55/11/e4a2bb08bb450fdbd42cc709dd40de4ed2c472cf0ccb9e64af22279c5495/wcwidth-0.1.7.tar.gz" } ] }