pyuca
a Python implementation of the Unicode Collation Algorithm
What it is and what it does
pyuca is a Python implementation of the Unicode Collation Algorithm (UCA), the standard method for sorting text in multiple languages and scripts. It passes conformance tests for Unicode versions from 5.2.0 through 10.0.0 depending on your Python version, and handles the linguistic nuances that plain string sorting misses: accents, diacritics, language-specific letter orderings (like Spanish ch), and character expansions (like German ä sorting as ae).
You use it by creating a Collator instance and passing its sort_key method to Python's sorted() function. For example, café correctly sorts before caff when using the collator, whereas standard sorting would place caff first. The package has no runtime dependencies and installs as a pure Python wheel, making it lightweight and portable.
Use it for:
- Sort user-facing lists (names, cities, products) in multilingual applications where accent and diacritic handling matters.
- Build search and filter systems that respect language-specific collation rules for better UX.
- Process linguistic or historical text data that requires proper Unicode-aware ordering.
- Implement locale-independent sorting in databases or APIs serving international users.
- Handle Spanish, German, French, and other language-specific letter orderings in sorted output.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements the Unicode Collation Algorithm to sort strings in non-English languages correctly, handling accents, contractions, and expansions according to Unicode standards.
Yes. pyuca is a stable, actively maintained implementation of a well-defined standard with zero dependencies, no security vulnerabilities, and permissive licensing. Install it if you need correct multilingual string sorting; it solves a real problem that Python's default sort does not. The last release was 2017, but the repository remains active and the algorithm is mature—this is not a red flag for a standards-based library.
Install
pyuca on PyPI
pip
pip install pyucauv
uv add pyucapoetry
poetry add pyucaInstalling pyuca
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of 2026-07-25 with stable status and 226 repository stars.
License in practice
MIT license (permissive) on Python code; allkeys.txt data file carries a similar license. No restrictions on commercial or proprietary use.
Quickstart
pip install pyuca
from pyuca import Collator
c = Collator()
sorted(["cafe", "caff", "café"], key=c.sort_key)
Verify before relying
- Whether Unicode 10.0.0 support (Python 3.7+) extends to newer Python versions released after 2017
- Performance characteristics on large datasets or real-world multilingual corpora
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 3,245 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 276,705/month — #8,159 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyuca-1.2-py2.py3-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
natsortnatsort provides natural sorting for strings…
permissive · top 1,000 on PyPI
UnidecodeConverts Unicode text to ASCII-safe…
copyleft · top 1,000 on PyPI
csvsortSorts large CSV files on disk using a…
copyleft · top 15,000 on PyPI
unisegDetermines Unicode text segmentation…
permissive · top 15,000 on PyPI
matchMaps tokenized words and phrases back to their…
permissive · top 5,000 on PyPI
pyjarowinklerComputes Jaro and Jaro-Winkler similarity and…
permissive · top 15,000 on PyPI
vokativConverts Czech given names and surnames into…
permissive · top 15,000 on PyPI
unicodedata2Provides updated Unicode character data tables…
permissive · top 15,000 on PyPI
MetaphoneImplements the Metaphone and Double Metaphone…
permissive · top 15,000 on PyPI
unicode-segmentation-rsProvides Unicode text segmentation (graphemes,…
unclear · top 15,000 on PyPI