i21y
i21y (a.k.a internationalization.py) is library for support i18n in Python with useful helpers. It is easy to use.
Features:
- Zero dependencies by default
- Simple design
- Utilities to simplify keys
Installation
- Normal:
pip install i21y - YAML support:
pip install i21y[yaml] - Fast JSON (by orjson) support:
pip install i21y[fast-json]
Example
Basic
from i21y import Translator
from i21y.loaders.json import Loader
t = Translator(Loader("locale"))
assert t("main.responses.not_found", locale="ja") == "見つからなかった。"
Advanced
from i21y import locale_str
LONG_KEY = locale_str("very.long.locale.key.yeah_so_long")
print(LONG_KEY.but_easy_to_use) # very.long.locale.key.yeah_so_long.but_easy_to_use
assert t(LONG_KEY.but_easy_to_use, locale="ja") == "とても長いキーでも簡単に使える。"
assert t(LONG_KEY + "but_easy_to_use", locale="ja") == "とても長いキーでも簡単に使える。"
Documentation
See the documentation for usage and details.
License
This project is licensed under the MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
i21y-0.4.2.tar.gz
(44.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
i21y-0.4.2-py3-none-any.whl
(10.8 kB
view details)
File details
Details for the file i21y-0.4.2.tar.gz.
File metadata
- Download URL: i21y-0.4.2.tar.gz
- Upload date:
- Size: 44.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b294019af63b1d87b57cb1af02ecc0001d45ed41c61fee3f6f28d4c44c49ef8
|
|
| MD5 |
e46e0de3251e252f238df33874370c7a
|
|
| BLAKE2b-256 |
a1727199dc40041a2467ae557339e395194b1fe53eb4c277a1a5745a4c36bb01
|
File details
Details for the file i21y-0.4.2-py3-none-any.whl.
File metadata
- Download URL: i21y-0.4.2-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42d727e17e9f2ff9060bb2519c87481c16ee8e1c6f6fcf2b8c15fa9352308074
|
|
| MD5 |
1472a5d995060a3dd01c87696ac45619
|
|
| BLAKE2b-256 |
ca16ed2cb9b9c154656e87227f30d81087821b546b5223a4bd90c8a72322676f
|