Metadata-Version: 2.4
Name: i21y
Version: 0.4.1
Summary: The simple library for i18n support.
Project-URL: Source, https://github.com/tasuren/i21y
Project-URL: Documentation, https://i21y.readthedocs.io/
Author-email: Takagi Tasuku <tasuren@outlook.jp>
License-Expression: MIT
License-File: LICENSE
Keywords: i18n
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Internationalization
Classifier: Typing :: Typed
Requires-Python: >=3.11
Provides-Extra: fast-json
Requires-Dist: orjson~=3.11.6; extra == 'fast-json'
Provides-Extra: yaml
Requires-Dist: pyyaml~=6.0; extra == 'yaml'
Description-Content-Type: text/markdown

[![PyPI](https://img.shields.io/pypi/v/i21y)](https://pypi.org/project/i21y/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/i21y)
![PyPI - License](https://img.shields.io/pypi/l/i21y)
[![Documentation Status](https://readthedocs.org/projects/i21y/badge/?version=latest)](https://i21y.readthedocs.io/en/latest/?badge=latest)

# i21y

i21y (a.k.a internationalization.py) is library for support i18n in Python. 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

```python
from i21y import Translator
from i21y.loaders.json import Loader

t = Translator(Loader("locale"))

assert t("main.responses.not_found", locale="ja") == "見つからなかった。"
```

### Advanced

```python
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](https://i21y.readthedocs.io/) for usage and details.

## License

This project is licensed under the MIT License.

## Contributing Guide

This project is managed by the package manager uv.  
In coding, please use Ruff as a code formatter and pyright for type checking. The configuration is described in `pyproject.toml`.  
Please write what you have done in a complete sentence and use the original form of the verb. e.g. `Fix that locale_str can't join`.
