$npx skillfedfor your agent

wcwidth

Measures the displayed width of unicode strings in a terminal

Worth itPyPI LibrariesReleased Jun 2026306.5M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — wcwidth-0.8.2-py3-none-any.whl
v0.8.2 · released 2026-06-29 · Python >=3.8

Yes. wcwidth is a stable, actively maintained library (Production/Stable status, recent release) with zero dependencies and broad Python support (3.8–3.15). It solves a real, widespread problem in terminal text handling that affects any CLI tool dealing with Unicode. No known vulnerabilities. The MIT license imposes no restrictions. Install it if your application formats text for terminals and handles non-ASCII characters.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with no runtime dependencies.
  • Active maintenance with recent release (46 days ago) and 463 repository stars.
  • Supports Python 3.8 through 3.15.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal attribution requirements.

last release 2026-06-29 (46 days) · last repo commit 2026-08-07 · 463 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 306,492,416 downloads/mo, #136 on PyPI

Verify before relying

pip install wcwidth

import wcwidth

# Measure width of a string with emoji
width = wcwidth.wcswidth('♀️')
print(width)  # Returns 2

# Measure with terminal-specific corrections
width = wcwidth.wcstwidth('♀️', term_program='vte')
print(width)  # Returns 1
  • Whether terminal-specific corrections via term_program parameter cover all major terminal emulators in practice
  • Performance characteristics when processing very large strings or high-volume text streams
Same gist for agents: .md · .json

What it is and what it does

wcwidth solves a fundamental problem in terminal text formatting: Python's built-in string functions like `str.ljust()`, `str.rjust()`, and `str.center()` measure string width by counting Unicode codepoints, not displayed cells. This breaks for wide characters (CJK, emoji), combining marks, and terminal escape sequences. wcwidth provides POSIX-compliant functions (`wcwidth()`, `wcswidth()`) and higher-level utilities (`width()`, `ljust()`, `rjust()`, `center()`, `wrap()`) that correctly measure displayed width and handle terminal control codes.

The library is designed for CLI and TUI programs that need precise output formatting. It handles complex Unicode (grapheme clusters, emoji with variation selectors, regional indicators), terminal escape sequences (SGR colors, cursor movement, tabs), and can apply terminal-specific corrections when needed. It also provides utilities like `clip()` to extract substrings by column position, `strip_sequences()` to remove escape codes, and iterator functions for navigating grapheme and sequence boundaries—essential for editors and REPLs with cursor control.

Use it for

  • Format table columns and aligned output in CLI tools where Unicode content must align correctly
  • Implement text wrapping in terminal applications that handle emoji, CJK text, or colored output
  • Build REPL or editor cursor navigation that respects grapheme cluster boundaries and escape sequences
  • Measure and truncate terminal output to fit within a fixed column width without breaking wide characters
  • Strip terminal escape sequences from logged or stored text while preserving semantic width information

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

wcwidth is a stable, actively maintained library (Production/Stable status, recent release) with zero dependencies and broad Python support (3.8–3.15). It solves a real, widespread problem in terminal text handling that affects any CLI tool dealing with Unicode. No known vulnerabilities. The MIT license imposes no restrictions. Install it if your application formats text for terminals and handles non-ASCII characters.

Install

wcwidth on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Active maintenance with recent release (46 days ago) and 463 repository stars. Supports Python 3.8 through 3.15.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal attribution requirements.

Quickstart

pip install wcwidth

import wcwidth

# Measure width of a string with emoji
width = wcwidth.wcswidth('♀️')
print(width)  # Returns 2

# Measure with terminal-specific corrections
width = wcwidth.wcstwidth('♀️', term_program='vte')
print(width)  # Returns 1

Verify before relying

  • Whether terminal-specific corrections via term_program parameter cover all major terminal emulators in practice
  • Performance characteristics when processing very large strings or high-volume text streams

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 46 days since the last release
Last repo commit
First released
Downloads306,492,416 / month, #136 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: POSIXProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: InternationalizationTopic :: Software Development :: LibrariesTopic :: Software Development :: LocalizationTopic :: TerminalsTyping :: Typed

Evidence: wcwidth-0.8.2-py3-none-any.whl

Tags

Capabilities
unicode terminal width measurementcjk character widthterminal string formattingemoji width calculationwcwidth wcswidthterminal escape sequence handlinggrapheme cluster width
Topics
unicode-handlingterminal-formattingcli-tui
PyPI keywords
cjkcombiningconsoleeastasianemojiemulatorterminalunicodewcswidthwcwidthxterm

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “unicode terminal width measurement”

  • wcwidthMeasures the displayed width of Unicode strings in terminals,…
  • cwcwidthcwcwidth provides fast Python bindings for POSIX wcwidth and wcswidth…
  • unicode-segmentation-rsProvides Unicode text segmentation (graphemes, words, sentences, line…

Give your agent the search over MCP, or paste the wish link into any chat.

More Libraries packages

urllib3 Worth it
PyPI · Libraries · released May 2026

urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.

MITpure Python · 3.10+
1.8Bdownloads / mo
requests Worth it
PyPI · Libraries · released May 2026

Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.

Apache-2.0pure Python · 3.10+
1.8Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
python-dateutil Worth it
PyPI · Libraries · released Mar 2024

Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.

Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.

Apache-2.0pure Python
1.2Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo

See also cwcwidth · colored · graphemeu · blessed · reprint · ansimarkup · grapheme · uniseg · rtfunicode · tendo