{"id":24784,"library":"unicode-rbnf","title":"unicode-rbnf","description":"Rule-based number formatting using Unicode CLDR data. Supports plural rules, ordinal rules, and other rule-based number formatting patterns. Current version 2.4.0, compatible with Python >=3.8.0.","status":"active","version":"2.4.0","language":"python","source_language":"en","source_url":"https://github.com/rhdunn/unicode-rbnf","tags":["unicode","number formatting","CLDR","rule-based","i18n"],"install":[{"cmd":"pip install unicode-rbnf","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import from the module is preferred.","wrong":"import rbnf; rbnf.RbnfEngine","symbol":"RbnfEngine","correct":"from rbnf import RbnfEngine"}],"quickstart":{"code":"from rbnf import RbnfEngine\n\n# Create engine for English (US) with default rules\nengine = RbnfEngine.for_language('en-US')\n# Format a number using the 'spellout' rule set\nresult = engine.format_number(1234, 'spellout')\nprint(result)  # e.g., 'one thousand two hundred thirty-four'","lang":"python","description":"Basic usage: create engine, format number with a rule set (e.g., 'spellout')."},"warnings":[{"fix":"If None is returned, ensure the language code is correct and that the CLDR data package is installed or loadable.","message":"RbnfEngine.for_language('en-US') may return None if the language data is not installed or incomplete. Always check the result.","severity":"gotcha","affected_versions":"all"},{"fix":"List available rule sets using engine.list_rules() or refer to CLDR documentation.","message":"Rule set names are case-sensitive and language-specific. 'spellout' is common but not all languages have it.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install unicode-rbnf' and ensure no typing errors.","cause":"The package is not installed or installed under a different name.","error":"ModuleNotFoundError: No module named 'rbnf'"},{"fix":"Use 'from rbnf import RbnfEngine'.","cause":"Trying to access RbnfEngine directly from the module instead of importing it.","error":"AttributeError: module 'rbnf' has no attribute 'RbnfEngine'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}