skillfed

pyicu

Python extension wrapping the ICU C++ API

pyicu v2.16.2 681.6K downloads/30d#5,362 on PyPI
Permissive license MIT Active released

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 pyicu

uv

uv add pyicu

poetry

poetry add pyicu

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: C++Programming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: InternationalizationTopic :: Software Development :: Localization

Tags

unicode text processing pythoninternationalization i18n librarycollation and sorting unicodelocale-aware formattingicu bindings pythonmultilingual text handlingunicode normalization
unicode-processinginternationalizationc-extension

More Internationalization packages