Registry / serialization / pyicumessageformat

pyicumessageformat

JSON →
library1.0.0pypypi✓ verified 82d ago

An unopinionated parser for ICU MessageFormat strings, currently at version 1.0.0. It parses ICU MessageFormat (used for internationalization) into an AST, allowing manipulation, analysis or transformation. The library is stable but maintenance-only with no active development.

pip install pyicumessageformat
INSTALL
IMPORT
SIG · PYICUMESSAGEFORMAT
P
pyicumessageformat
serializationpythonv1.0.0
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Parser
from pyicumessageformat import Parser
from pyicumessageformat import parse
constants
from pyicumessageformat import constants
parser
from pyicumessageformat import parser

Parse an ICU MessageFormat string into an AST.

from pyicumessageformat import parse message = "Hello, {name}! You have {count, plural, one {# message} other {# messages}}." tree = parse(message) print(tree) # Output: MessageFormatNode(...)
Debug
Known issues
gotchaThe library only parses; it does NOT format or resolve messages. Use a library like icu (PyICU) or babel to actually substitute variables.
fix
Combine with a formatter, e.g., using pyicu (PyICU) or icu4c.
affects: >=1.0.0
gotchaParsing incomplete or malformed ICU patterns may raise exceptions; validation is minimal.
fix
Wrap parse() in try/except and handle parse errors gracefully.
affects: >=1.0.0
Upgrade
Version history
1.0.0latest on PyPI · released Sep 22, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
pyicumessageformat — pip install pyicumessageformat · libregistry