Registry / serialization / resourcebundle

resourcebundle

JSON →
library2.2.0pypypiunverified

ResourceBundle is an i18n module for managing string resources in Python, supporting .properties, JSON, and YAML formats. Current version is 2.2.0, requiring Python >=3.5. It follows Java ResourceBundle patterns with locale fallback.

pip install resourcebundle
INSTALL
IMPORT
SIG · RESOURCEBUNDLE
R
resourcebundle
serializationpythonv2.2.0
Install
1.6s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.2.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.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

ResourceBundle
✓ from ResourceBundle import ResourceBundle
✗ from resourcebundle import ResourceBundle

Create a ResourceBundle with base name 'messages', locale 'en', and get a string 'greeting'.

from resourcebundle import ResourceBundle import os # Create a bundle with base name 'messages' in current directory bundle = ResourceBundle('messages', base_path='.', locale='en') print(bundle.get('greeting', default='Hello')) # Output: Hello (or translated value if 'messages_en.properties' exists)
Debug
Known issues
breakingv2.0.0 introduced breaking changes to the API and file format support. Code written for v1.x may require migration.
fix
Check the changelog and update your code to use the new API (e.g., ResourceBundle constructor arguments changed).
affects: >=2.0.0
deprecatedBuilt-in XML support is deprecated and may be removed in a future release.
fix
Use JSON or YAML format instead of XML.
affects: >=2.0.0
gotchaResourceBundle silently accepts non-existent base names (until v2.0.1). In v2.0.1+, an error is raised if no files found.
fix
Upgrade to v2.0.1 or later, or ensure the base name exists.
affects: <2.0.1
gotchaLine continuations in .properties files (using backslash) are only supported from v2.0.5 onward.
fix
Upgrade to v2.0.5+ if you use multi-line property values.
affects: <2.0.5
Upgrade
Version history
2.2.0latest on PyPI · released Apr 18, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
resourcebundle — pip install resourcebundle · libregistry