Metadata-Version: 2.4
Name: turkicase
Version: 0.1.0
Summary: Pure-Python Unicode-aware casing for Turkic Latin text
License-Expression: MIT
Keywords: unicode,turkic,turkish,azerbaijani,casing,lowercase
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: twine>=6; extra == "dev"
Dynamic: license-file

# turkicase

A tiny, dependency-free Python package for Unicode-aware Turkic casing.

It preserves the two distinct Latin I case pairs used by Turkish, Azerbaijani, and Common Turkic Alphabet text:

- `I ↔ ı`
- `İ ↔ i`

Python's default `str.lower()` and `str.casefold()` are locale-independent, so
`"I".lower()` becomes `"i"`. This package applies the Turkic special-casing
rules from Unicode while retaining Python's normal casing behavior for all
other characters.

## Installation

From a local checkout:

```bash
python -m pip install .
```

After publication on PyPI:

```bash
python -m pip install turkicase
```

## Usage

```python
from turkicase import lower, upper, casefold

lower("IĞDIR")       # "ığdır"
lower("İSTANBUL")    # "istanbul"
upper("izmir")       # "İZMİR"
upper("ışık")        # "IŞIK"

casefold("I") == casefold("ı")  # True
casefold("İ") == casefold("i")  # True
```

The longer aliases are also available:

```python
from turkicase import common_turkic_lower, common_turkic_upper, common_turkic_casefold
```

## Combining marks

The implementation includes Unicode's contextual `Before_Dot` and `After_I`
rules, so canonically equivalent decomposed input is handled correctly:

```python
lower("I\u0307")  # "i"
```

The result is normalized to NFC by default. Casing contexts are always
evaluated on the original input code points. Pass `normalization=None` to skip
result normalization.

## Development

```bash
python -m pip install -e ".[dev]"
pytest
python -m build
python -m twine check dist/*
```

## License

MIT
