Skip to main content

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

Contributing

Contributions are welcome. To contribute:

  1. Fork the repository.
  2. Create a feature branch with a descriptive name.
  3. Make focused changes and update tests where relevant.
  4. Run the test suite and build the package locally.
  5. 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

kannada_ascii_unicode-0.1.3.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kannada_ascii_unicode-0.1.3-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

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

Hashes for kannada_ascii_unicode-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4b6abdf16ca7b631149957bab3c87bd8c14220e328f15228139a7b28c1095fb4
MD5 231412085093567e1a981523a5ad8ac2
BLAKE2b-256 cbd1d9145d149e99cc12b4ef56024447b324fd03006bb3724386edcbacb3ca4e

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kannada_ascii_unicode-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for kannada_ascii_unicode-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c365e58996da52823791f3aa71ba4d52b7851ed39aeadcaabf8ede3df94f36f2
MD5 ff027856081ef5b2778f055a28d99d18
BLAKE2b-256 b8c1b26cf2d9e7bbe7015b9de573c192e902a6af214c3015db4abc62465b330f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page