Metadata-Version: 2.5
Name: qazaqify
Version: 0.1.0
Summary: Kazakh formatting and localization for Python
Project-URL: Homepage, https://github.com/Rnurdaulet/qazaqify-python
Project-URL: Repository, https://github.com/Rnurdaulet/qazaqify-python
Author: Nurdaulet Rakhymberdi
License: MIT
License-File: LICENSE
Keywords: formatting,i18n,kazakh,l10n,locale,qazaq
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# qazaqify

[![Python](https://img.shields.io/badge/python-3.10+-3776AB?logo=python&logoColor=white)](https://www.python.org/downloads/)
[![CI](https://github.com/Rnurdaulet/qazaqify-python/actions/workflows/ci.yml/badge.svg)](https://github.com/Rnurdaulet/qazaqify-python/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![PyPI](https://img.shields.io/pypi/v/qazaqify)](https://pypi.org/project/qazaqify/)

Kazakh formatting and localization for Python.

Dates, numbers, currency, relative time, units, and UI formatting for Python.

You don't have to build Kazakh UI text with `f"{days} күн бұрын"`. Call a function and get ready-to-use text.

## Installation

```bash
pip install qazaqify
```

## Usage

```python
from datetime import datetime, timezone

from qazaqify import (
    DateStyle,
    TimeStyle,
    format_date,
    format_time,
    format_datetime,
    relative_time,
    calendar,
    format_interval,
    number,
    currency,
    currency_words,
    percent,
    unit,
    bytes,
    duration,
    human_duration,
    ordinal,
    words,
    join,
    join_or,
    message,
)

t = datetime(2026, 9, 4, 14, 30, tzinfo=timezone.utc)

format_date(t, DateStyle.LONG)
# "2026 ж. 4 қыркүйек"

format_time(t, TimeStyle.SHORT)
# "14:30"

format_datetime(t)
# "4 қыркүйек 2026, 14:30"

relative_time(t)
# "5 минут бұрын"

calendar(t, now)
# "бүгін, 14:30"

format_interval(start, end)
# "2026 ж. 4–10 қыркүйек"

number(1234567.89)
# "1 234 567,89"

currency(12500, "KZT")
# "12 500 ₸"

currency_words(12500)
# "он екі мың бес жүз теңге"

percent(0.75)
# "75%"

unit(1500, "meter")
# "1,5 км"

bytes(1536000)
# "1,5 МБ"

duration(3665)
# "1 сағат 1 минут 5 секунд"

human_duration(3665)
# "шамамен 1 сағат"

ordinal(21)
# "21-ші"

words(123)
# "жүз жиырма үш"

join(["Алма", "алмұрт", "өрік"])
# "Алма, алмұрт және өрік"

join_or(["Алма", "алмұрт", "өрік"])
# "Алма, алмұрт немесе өрік"

message("{count} жаңа хабарлама", count=5)
# "5 жаңа хабарлама"
```

`DateStyle` / `TimeStyle` also accept strings: `format_date(t, "long")`.

`bytes` shadows the builtin when imported by name. Use `from qazaqify import bytes as format_bytes` if you still need the builtin in the same scope.

## Features

* Date and time formatting
* Relative time
* Date and time intervals
* Calendar helpers
* Number formatting
* Numbers in words
* Ordinal numbers
* Currency formatting
* Percentages
* Units and byte sizes
* Durations
* List formatting
* Simple message formatting
* Kazakh locale data

## Development

```bash
pip install -e ".[dev]"
pytest
```

## License

MIT License
