pyicu
Python extension wrapping the ICU C++ API
What it is and what it does
PyICU is a Python extension that wraps the ICU (International Components for Unicode) C++ libraries, providing direct access to the Unicode Consortium's internationalization and localization tools. It implements much of the Unicode Standard, Unicode Technical Standards, and Unicode CLDR, enabling developers to handle text processing tasks that require locale awareness, proper collation, script detection, and multilingual support.
The package is used when you need production-grade Unicode and internationalization features beyond Python's built-in string handling. It handles collation, number and date formatting in different locales, text normalization, bidirectional text, script detection, and other complex text operations. Because PyICU is a C++ extension wrapping native libraries, it offers performance and feature completeness that pure-Python alternatives cannot match, but at the cost of requiring system-level ICU installation and compilation during setup.
Use it for:
- Sort user-generated text correctly in different languages using locale-aware collation rules
- Format dates, times, and numbers according to regional conventions for international applications
- Normalize Unicode text and detect script boundaries in multilingual documents
- Build search and filtering systems that respect language-specific text comparison rules
- Process bidirectional text and handle complex script combinations
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyICU wraps the ICU C++ libraries to provide Python access to Unicode text processing, internationalization, and localization features including collation, formatting, and script handling.
Yes, if you need production-grade internationalization and Unicode handling. PyICU is stable (Production/Stable status, active maintenance, no known vulnerabilities) and widely used. Install only if your system can satisfy the high build-time friction: pre-built packages exist for major platforms, but source builds require ICU libraries, pkg-config, and a matching C++ compiler. Avoid if you need a pure-Python solution or cannot install system dependencies.
Install
pyicu on PyPI
pip
pip install pyicuuv
uv add pyicupoetry
poetry add pyicuInstalling pyicu
Before you install
Installation requires high friction: the ICU C++ libraries and headers must be pre-installed on your system, and PyICU builds from source rather than offering pre-built wheels on all platforms. Pre-built packages are available on macOS (Homebrew, Macports), Debian, Ubuntu, Alpine, NetBSD, and OpenBSD; building from source requires pkg-config and a C++ compiler matching your Python distribution.
License in practice
PyICU is licensed under MIT, a permissive open-source license that allows commercial and private use with minimal restrictions.
Quickstart
# After installing ICU libraries and PyICU
import pyicu
# Create a collator for locale-aware string comparison
locale = pyicu.Locale('en_US')
collator = pyicu.Collator.createInstance(locale)
result = collator.compare('apple', 'Apple')
The ICU C++ libraries and development headers must be installed on your system before installing PyICU. On macOS, this typically requires Homebrew or Macports; on Linux, the libicu-dev package; on Windows, manual ICU installation. The C++ compiler used must match your Python distribution's compiler.
Verify before relying
- Whether pre-built wheels are available for the current version on PyPI for common platforms
- Current maintenance activity and response time for issues on the GitLab repository
- Performance characteristics compared to pure-Python Unicode libraries for typical workloads
- Specific API surface and feature completeness relative to native ICU C++ library
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | actively maintained — 147 days since the last release |
| First released | |
| Downloads | 681,592/month — #5,362 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyicu-2.16.2.tar.gz
Tags
More Internationalization packages
Measures the displayed width of Unicode strings…
permissive · top 1,000 on PyPI
babelBabel provides internationalization (i18n) and…
permissive · top 1,000 on PyPI
pycountryProvides programmatic access to ISO standard…
copyleft · top 1,000 on PyPI
num2wordsConverts numbers to their word representations…
copyleft · top 5,000 on PyPI
polibpolib reads, writes, and manipulates gettext…
permissive · top 5,000 on PyPI
pyunormalizeProvides Unicode normalization (NFC, NFD, NFKC,…
permissive · top 5,000 on PyPI
zope.i18nProvides internationalization and localization…
unclear · top 15,000 on PyPI
flufl.i18nflufl.i18n provides a high-level API for…
permissive · top 15,000 on PyPI
unisegDetermines Unicode text segmentation…
permissive · top 15,000 on PyPI
normalityNormality removes diacritics, punctuation, and…
permissive · top 15,000 on PyPI
quart_babelAdds internationalization (i18n) and…
permissive · top 15,000 on PyPI
oslo.i18noslo.i18n provides utilities for handling…
permissive · top 5,000 on PyPI
pyucaImplements the Unicode Collation Algorithm to…
permissive · top 15,000 on PyPI
translationstringProvides translation string objects and…
permissive · top 5,000 on PyPI