graphemeu
Unicode grapheme helpers
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 on this page — 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
graphemeu on PyPI
pip
pip install graphemeuuv
uv add graphemeupoetry
poetry add graphemeuInstalling 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 the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 218 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,153,333/month — #3,248 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: graphemeu-0.10.0-py3-none-any.whl
Keywords: grapheme, unicode
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
graphemeProvides string manipulation functions that…
permissive · top 5,000 on PyPI
unisegDetermines Unicode text segmentation…
permissive · top 15,000 on PyPI
unicode-segmentation-rsProvides Unicode text segmentation (graphemes,…
unclear · top 15,000 on PyPI
unicodedataplusExtends Python's built-in unicodedata module…
permissive · top 15,000 on PyPI
tangled-up-in-unicodeProvides detailed Unicode character properties…
permissive · top 15,000 on PyPI
emojiConverts between emoji characters and their…
permissive · top 1,000 on PyPI
confusable-homoglyphsDetects Unicode homoglyphs and mixed-script…
permissive · top 5,000 on PyPI
anyasciiConverts Unicode text to ASCII-only equivalents…
permissive · top 5,000 on PyPI
wcwidthMeasures the displayed width of Unicode strings…
permissive · top 1,000 on PyPI
confusablesDetects and matches words that appear identical…
permissive · top 15,000 on PyPI