Metadata-Version: 2.1
Name: i21y
Version: 0.2.0
Summary: The simple library for i18n support.
Keywords: i18n
Author-Email: Takagi Tasuku <tasuren@outlook.jp>
License: MIT License
        
        Copyright (c) 2023 Takagi Tasuku
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Internationalization
Classifier: Typing :: Typed
Project-URL: Source, https://github.com/tasuren/i21y
Project-URL: Documentation, https://i21y.readthedocs.io/
Project-URL: Donate, https://www.buymeacoffee.com/tasuren
Project-URL: Chat, https://discord.gg/kfMwZUyGFG
Requires-Python: >=3.11
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 - Downloads](https://img.shields.io/pypi/dm/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) [![Buy Me a Coffee](https://img.shields.io/badge/-tasuren-E9EEF3?label=Buy%20Me%20a%20Coffee&logo=buymeacoffee)](https://www.buymeacoffee.com/tasuren)
# 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
- Tools 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") == "とても長いキーでも簡単に使える。"
```

## Documentation
See the [documentation](https://i21y.readthedocs.io/) for usage and details.

## License
i21y is licensed under the [MIT license](https://github.com/tasuren/i21y/blob/main/LICENSE).