Metadata-Version: 2.4
Name: vesna
Version: 1.0.2
Summary: A small library specialising in convenient localisation
Project-URL: Homepage, https://github.com/BRamil0/vesna
Project-URL: Issues, https://github.com/BRamil0/vesna/issues
Author-email: Qulowg <qulowg@gmail.com>
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Internationalization
Classifier: Topic :: Software Development :: Localization
Requires-Python: >=3.14
Requires-Dist: aiofiles
Requires-Dist: pydantic
Provides-Extra: all
Requires-Dist: babel; extra == 'all'
Requires-Dist: fluent-runtime; extra == 'all'
Requires-Dist: hjson; extra == 'all'
Requires-Dist: json5; extra == 'all'
Requires-Dist: pytest; extra == 'all'
Requires-Dist: pytest-asyncio; extra == 'all'
Requires-Dist: rtoml; extra == 'all'
Requires-Dist: ruamel-yaml; extra == 'all'
Requires-Dist: ruff; extra == 'all'
Requires-Dist: ty; extra == 'all'
Description-Content-Type: text/markdown

## Vesna

__[Українська](README.uk.md)__

#### Description
A lightweight library specialized in convenient localization (i18n).

### Installation

Via `uv` (**recommended**):
- `uv pip install vesna` — Minimal
- `uv pip install vesna[all]` — Full

Via `pip`:
- `python -m pip install vesna` — Minimal
- `python -m pip install vesna[all]` — Full

### Quick Start

```python
import vesna

async def main():
    await vesna.i18n.load_file(
        vesna.providers.ProviderJSON(), "uk", "tests/localisation/{locale_code}.json"
    )

    l = vesna.Locale("uk")
    print(l["vesna"])
    print(l("hello", l.get("world")))
```

### Features
- Support for multiple localization formats
- Convenient syntax with `[]` and `()` support
- `Babel` integration

### Usage

#### Providers
- `FluentProvider`: Fluent format (requires `fluent.runtime`).
- `GettextProvider`: GNU Gettext format (requires `Babel`).
- `ProviderJSON`: JSON format (uses `pydantic_core`, requires `pydantic`).
- `ProviderJSON5`: JSON5 format (requires `json5` or `pyjson5`).
- `ProviderHJSON`: HJSON format (requires `hjson`).
- `ProviderTOML`: TOML format (requires `rtoml`).
- `ProviderYAML`: YAML format (requires `ruamel.yaml`).

#### Creating a custom `Vesna` instance
```python
import vesna
v = vesna.Vesna()
# Set as the global default object
v.default_object = v
```

### License
This project is licensed under the **MIT** License. See the [LICENSE](LICENSE) file for details.