Kannada ASCII ↔ Unicode converter (basic mapping-based)
Project description
Kannada ASCII ↔ Unicode Converter
The Kannada ASCII ↔ Unicode Converter is a Python package for converting Kannada text between legacy ASCII-based representations and modern Unicode text. It is intended for migration, archival, and text-processing workflows where Kannada content may need to move between older encoding forms and Unicode.
Overview
This package provides:
- conversion from ASCII-style Kannada text to Unicode
- conversion from Unicode Kannada text to ASCII-style output
- file-based conversion for plain text and DOCX documents
- a simple public API for integration into scripts and applications
The implementation uses bundled mapping data and a conversion engine designed for common Kannada transliteration and mapping scenarios.
Installation
Install from PyPI:
pip install kannada-ascii-unicode
Quick Start
from kannada_converter import KannadaConverter, ascii_to_unicode, unicode_to_ascii
converter = KannadaConverter()
ascii_text = "PÀÄ"
unicode_text = converter.convert_ascii_to_unicode(ascii_text)
print(unicode_text) # ಕು
print(unicode_to_ascii("ಕು")) # PÀÄ
A more complete example is included in the sample application:
python testapp/app.py
Public API
The package exposes the following public entry points:
from kannada_converter import (
KannadaConverter,
ascii_to_unicode,
ascii_to_unicode_file,
unicode_to_ascii,
unicode_to_ascii_file,
)
Core class
from kannada_converter import KannadaConverter
converter = KannadaConverter()
String conversion
converter.convert_ascii_to_unicode("PÀ")
converter.convert_unicode_to_ascii("ಕ")
File conversion
converter.convert_ascii_to_unicode_file("input.txt", "output.txt")
converter.convert_unicode_to_ascii_file("input.docx", "output.docx")
The file conversion helpers infer an output path when none is provided and preserve basic formatting for DOCX files.
Notes on Accuracy and Scope
This package is designed for practical mapping-based conversion and is suitable for many common Kannada transliteration workflows. Some complex or legacy cases may require additional mapping work or manual review. The bundled test suite provides a baseline for expected behavior and should be used as a reference when extending the converter.
Development
1. Create and activate a virtual environment
python -m venv .venv
.venv\Scripts\Activate.ps1
2. Install development dependencies
python -m pip install --upgrade pip
pip install build pytest twine
3. Run the test suite
pytest -q
4. Build the package locally
python -m build
5. Validate the distribution files
twine check dist/*
Release and Publishing
A local publishing helper is available at publish.ps1.
./publish.ps1
The script performs the following steps:
- removes old build artifacts
- builds the package
- validates the distribution with twine
- prompts for a PyPI API token
- uploads the package to PyPI
The repository also contains a GitHub Actions workflow at .github/workflows/python-publish.yml. It builds the package and can publish to PyPI when configured for a release event.
Project Structure
- kannada_converter/ - package source and public API
- kannada_converter/mappings/ - bundled mapping data
- tests/ - automated regression tests
- testapp/ - runnable sample application
- publish.ps1 - local package publishing helper
- .github/workflows/python-publish.yml - CI/CD workflow for packaging and publishing
Contributing
Contributions are welcome. To contribute:
- Fork the repository.
- Create a feature branch with a descriptive name.
- Make focused changes and update tests where relevant.
- Run the test suite and build the package locally.
- Open a pull request with a summary of the change and the validation performed.
License
This project is licensed under the MIT License.
Author
Ravikumar Pawar
GitHub: https://github.com/kagapa-blr
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kannada_ascii_unicode-0.1.3.tar.gz.
File metadata
- Download URL: kannada_ascii_unicode-0.1.3.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b6abdf16ca7b631149957bab3c87bd8c14220e328f15228139a7b28c1095fb4
|
|
| MD5 |
231412085093567e1a981523a5ad8ac2
|
|
| BLAKE2b-256 |
cbd1d9145d149e99cc12b4ef56024447b324fd03006bb3724386edcbacb3ca4e
|
Provenance
The following attestation bundles were made for kannada_ascii_unicode-0.1.3.tar.gz:
Publisher:
python-publish.yml on kagapa-blr/py-kannada-ascii-unicode
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kannada_ascii_unicode-0.1.3.tar.gz -
Subject digest:
4b6abdf16ca7b631149957bab3c87bd8c14220e328f15228139a7b28c1095fb4 - Sigstore transparency entry: 2071515137
- Sigstore integration time:
-
Permalink:
kagapa-blr/py-kannada-ascii-unicode@2f829e013d116d2ec776dcb5ec9476a5a9a77e18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kagapa-blr
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2f829e013d116d2ec776dcb5ec9476a5a9a77e18 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kannada_ascii_unicode-0.1.3-py3-none-any.whl.
File metadata
- Download URL: kannada_ascii_unicode-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c365e58996da52823791f3aa71ba4d52b7851ed39aeadcaabf8ede3df94f36f2
|
|
| MD5 |
ff027856081ef5b2778f055a28d99d18
|
|
| BLAKE2b-256 |
b8c1b26cf2d9e7bbe7015b9de573c192e902a6af214c3015db4abc62465b330f
|
Provenance
The following attestation bundles were made for kannada_ascii_unicode-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on kagapa-blr/py-kannada-ascii-unicode
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kannada_ascii_unicode-0.1.3-py3-none-any.whl -
Subject digest:
c365e58996da52823791f3aa71ba4d52b7851ed39aeadcaabf8ede3df94f36f2 - Sigstore transparency entry: 2071515255
- Sigstore integration time:
-
Permalink:
kagapa-blr/py-kannada-ascii-unicode@2f829e013d116d2ec776dcb5ec9476a5a9a77e18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kagapa-blr
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2f829e013d116d2ec776dcb5ec9476a5a9a77e18 -
Trigger Event:
push
-
Statement type: