--- id: uniseg version: "0.10.1" license: unclear license_treatment: permissive maintenance: aging --- # uniseg — Determine Unicode text segmentations License: permissive · Maintenance: aging · Downloads: 98.4K/mo ## What it is and what it does uniseg is a pure-Python library for determining Unicode text segmentation boundaries according to the Unicode Standard. It provides functions to identify grapheme cluster boundaries (user-perceived characters that may span multiple code points), word breaks, sentence breaks, and line break opportunities. The package also includes text-wrapping classes for both monospace (console) and proportional (graphical) font environments, making it useful for applications that need to handle text layout and display correctly across different writing systems. The library implements the Unicode Standard Annex rules for text segmentation without requiring external C libraries or dictionaries. This makes it more portable than alternatives like PyICU, though potentially slower. It supports current Python versions (3.9 through 3.13) and recently achieved a milestone by passing all Unicode breaking tests in version 0.9.0, indicating improved correctness for edge cases. Use it for: - Implement proper text wrapping in CLI tools that must respect Unicode line-breaking rules across different scripts. - Build text editors or word processors that need to identify grapheme cluster boundaries for cursor positioning and text selection. - Process multilingual text to find word boundaries without relying on language-specific dictionaries. - Format console output with correct line breaks for Unicode strings containing combining characters or emoji. - Analyze or segment Unicode text in natural language processing pipelines that require Unicode-aware boundaries. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Determines Unicode text segmentation boundaries—grapheme clusters, words, sentences, and line breaks—using Unicode Standard Annex rules, and provides text wrapping for console and graphical environments. Yes, if you need Unicode-aware text segmentation in pure Python. The package is stable, has no dependencies, and recently achieved full Unicode test compliance. Install friction is minimal. The aging maintenance status (217 days since last release) is a minor concern for a mature library, but the recent test milestone and current Python version support suggest active stewardship. Avoid if you need maximum performance—PyICU is faster but requires compilation and external libraries. ## Install pip install uniseg uv add uniseg poetry add uniseg ## Installing uniseg Before you install: Low install friction; pure Python with no runtime dependencies. Maintenance status is aging—last release was 217 days ago—but the package recently passed all Unicode breaking tests and supports current Python versions (3.9+). License in practice: Licensed under MIT (permissive), imposing no restrictions on use, modification, or distribution. Quickstart: pip install uniseg import uniseg.graphemecluster import uniseg.wordbreak import uniseg.linebreak for cluster in uniseg.graphemecluster.graphemeclusters('café'): print(cluster) for word in uniseg.wordbreak.words('hello world'): print(word) Requires Python 3.9 or later. Verify before relying: - Performance characteristics compared to PyICU or other segmentation libraries for large-scale text processing. - Whether the package's rule-based grapheme cluster segmentation (reintroduced in 0.9.0) handles all modern Unicode combining sequences correctly. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 98.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags unicode text segmentation, grapheme cluster boundaries, word break detection, line breaking algorithm, unicode-aware text wrapping, sentence boundary detection, unicode text processing, unicode, text-segmentation, internationalization [View on SkillFed](https://skillfed.io/packages/uniseg) · [View on PyPI](https://pypi.org/project/uniseg/)