skillfed

pyuca

a Python implementation of the Unicode Collation Algorithm

pyuca v1.2 276.7K downloads/30d#8,159 on PyPI226
Permissive license MIT Active released

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 pyuca

uv

uv add pyuca

poetry

poetry add pyuca

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Text Processing

Tags

unicode collation algorithmsort non-english stringsmultilingual string sortingunicode text collationaccent-aware sortinginternational text ordering
unicodeinternationalizationcollation

More Text Processing packages