Metadata-Version: 2.4
Name: kannada-ascii-unicode
Version: 0.1.2
Summary: Kannada ASCII ↔ Unicode converter (basic mapping-based)
Author: Ravikumar Pawar
License-Expression: MIT
Project-URL: Homepage, https://github.com/kagapa-blr/py-kannada-ascii-unicode
Project-URL: Repository, https://github.com/kagapa-blr/py-kannada-ascii-unicode
Keywords: kannada,unicode,ascii,conversion,indic,indian-language
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Kannada ASCII ↔ Unicode Converter

A lightweight Python library for converting Kannada text between legacy ASCII-based encodings and modern Unicode.

This package is useful for:

- legacy Kannada ASCII data and fonts
- Unicode migration work
- text processing and validation

---

## Installation

```bash
pip install kannada-ascii-unicode
```

---

## Quick Start

```python
from kannada_converter import KannadaConverter

converter = KannadaConverter()

ascii_text = "¥ÀAiÀiÁðAiÀÄªÁV"
unicode_text = converter.convert_ascii_to_unicode(ascii_text)
print(unicode_text)  # ಪರ್ಯಾಯವಾಗಿ
```

```python
from kannada_converter import unicode_to_ascii

print(unicode_to_ascii("ಪರ್ಯಾಯವಾಗಿ"))
```

---

## API Overview

```python
from kannada_converter import KannadaConverter, ascii_to_unicode, unicode_to_ascii

converter = KannadaConverter()

converter.convert_ascii_to_unicode("PÀ")
converter.convert_unicode_to_ascii("ಕ")
```

---

## Project Status

This project is currently in an early but usable state.

- basic ASCII ↔ Unicode conversion works
- complex conjuncts and full round-trip accuracy are still being improved
- the package layout and public API are now organized for publication and maintenance

---

## How It Works

- uses JSON-backed Kannada mapping data from the bundled resource file
- applies mapping-based conversion rules for ASCII and Unicode text
- supports a simple sample app and test suite for validation

---

## Development and Testing

### 1. Create and activate a virtual environment

```bash
python -m venv .venv
.venv\Scripts\Activate.ps1
```

### 2. Install development dependencies

```bash
python -m pip install --upgrade pip
pip install build pytest twine
```

### 3. Run the test suite

```bash
pytest -q
```

### 4. Run the sample app

```bash
python testapp/app.py
```

### 5. Build the package locally

```bash
python -m build
```

### 6. Validate the distribution files

```bash
twine check dist/*
```

### Recommended development workflow

- make changes in a dedicated feature branch
- add or update tests for any new behavior
- run the full test suite before opening a PR
- keep public API changes intentional and documented
- prefer small, focused pull requests

---

## Build and Publish

### Build locally

```bash
python -m build
```

This creates the distribution files in the dist folder.

### Validate the package

```bash
twine check dist/*
```

### Publish with PowerShell

A helper script is included at [publish.ps1](publish.ps1).

```powershell
./publish.ps1
```

The script will:

- clean old build artifacts
- build the package
- validate it with twine
- prompt for your PyPI API token
- upload the package to PyPI

### Publish through GitHub Actions

A GitHub Actions workflow is already present in [.github/workflows/python-publish.yml](.github/workflows/python-publish.yml).

It will build the package on push and publish to PyPI when a GitHub Release is published.

> For PyPI publishing through GitHub Actions, make sure the repository is configured with the required PyPI trusted publisher settings.

---

## Contributing

Contributions are welcome.

1. Fork the repository.
2. Create a feature branch with a clear name such as `feature/your-change` or `fix/issue-name`.
3. Make your changes and add or update tests where relevant.
4. Run the test suite and verify the package still builds.
5. Open a pull request with a short summary, the motivation for the change, and any testing notes.

### Contribution guidelines

- keep changes focused and easy to review
- avoid breaking the public API unless the change is intentional
- update documentation when behavior or usage changes
- include regression tests for bug fixes and new conversions
- follow the existing package layout and naming patterns

### For maintainers

When preparing a release:

- update the package version in [pyproject.toml](pyproject.toml)
- ensure tests are passing
- build and validate the distribution files
- publish the release with a clear changelog summary

---

## Project Structure

- [kannada_converter/](kannada_converter/) - package source
- [kannada_converter/mappings/](kannada_converter/mappings/) - bundled conversion mappings
- [tests/](tests/) - automated tests
- [testapp/](testapp/) - runnable example app
- [publish.ps1](publish.ps1) - local publish helper
- [.github/workflows/python-publish.yml](.github/workflows/python-publish.yml) - CI/CD publish workflow

---

## License

MIT License

---

## Author

Ravikumar Pawar  
GitHub: <https://github.com/kagapa-blr>
