--- id: graphemeu version: "0.10.0" license: MIT license_treatment: permissive maintenance: aging --- # graphemeu — Unicode grapheme helpers License: permissive · Maintenance: aging · Downloads: 2.2M/mo ## What it is and what it does graphemeu is a Unicode-aware string library that treats grapheme clusters—the user-perceived characters that may span multiple Unicode code points—as the fundamental unit of text manipulation. Standard Python string functions count and slice by individual Unicode characters, which can split combining marks, emoji modifiers, and other multi-codepoint sequences. This package implements the Unicode Standard Annex #29 rules to correctly identify grapheme boundaries and provides functions like length(), slice(), and contains() that operate on graphemes instead. The library is most useful when you need to count or truncate text the way users see it—for example, when formatting text-based tables, enforcing display width limits, or ensuring that truncation doesn't corrupt combining marks or emoji. It trades performance for correctness: grapheme operations scale linearly with string length and are notably slower than Unicode code-point operations, so it's best suited for relatively short strings or operations on the beginning of long strings. Use it for: - Count visible characters in user input for UI validation or display length constraints. - Truncate or slice text at user-perceived boundaries without corrupting combining marks or emoji modifiers. - Format text-based tables or monospaced output where column widths must match perceived character width. - Process strings containing emoji with skin-tone or gender modifiers as single units. - Validate text length for systems that measure by grapheme clusters rather than Unicode code points. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides string manipulation functions that work with user-perceived characters (grapheme clusters) as defined by Unicode Standard Annex #29, rather than individual Unicode code points. Yes, if you need correct grapheme-aware string handling. The package has no dependencies, installs easily, and carries no security vulnerabilities. The aging maintenance status (218 days since release) is a minor concern but not a blocker—the library is a stable fork that updates with Unicode versions. Install it when user-perceived character boundaries matter more than raw performance; avoid it if you're working with very long strings or can tolerate Unicode code-point semantics. ## Install pip install graphemeu uv add graphemeu poetry add graphemeu ## Installing graphemeu Before you install: Low friction: pure Python wheel with no runtime dependencies. Maintenance status is aging—last release 218 days ago—but the repository is active and the package is a maintained fork addressing Unicode 17.0.0. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you retain the license notice. Quickstart: pip install graphemeu import graphemeu as grapheme string = 'u̲n̲d̲e̲r̲l̲i̲n̲e̲d̲' print(grapheme.length(string)) # 10 (user-perceived characters) print(grapheme.slice(string, 0, 3)) # 'u̲n̲d̲' Requires Python 3.10 or later. Verify before relying: - Whether the aging maintenance status (218 days since last release) will continue to track future Unicode versions. - Real-world performance characteristics on production workloads beyond the documented 10,000-character ASCII benchmark. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 2.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags grapheme cluster manipulation, unicode string length by user characters, slice strings by perceived characters, grapheme-aware text processing, unicode combining marks handling, emoji modifier support, unicode, text-processing, grapheme-clusters [View on SkillFed](https://skillfed.io/packages/graphemeu) · [View on PyPI](https://pypi.org/project/graphemeu/)