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.4.tar.gz (14.3 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.4-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file kannada_ascii_unicode-0.1.4.tar.gz.

File metadata

  • Download URL: kannada_ascii_unicode-0.1.4.tar.gz
  • Upload date:
  • Size: 14.3 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.4.tar.gz
Algorithm Hash digest
SHA256 42d52f8c175b76e4eeef3c24874ed2d04cb5d38913269de103ea4ef0d0eedf1d
MD5 90a0a480c2236035eb8d9b60a9db9684
BLAKE2b-256 8494ed8b139b160bc87801534245842cae4307631f87196088051d213a5af198

See more details on using hashes here.

Provenance

The following attestation bundles were made for kannada_ascii_unicode-0.1.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for kannada_ascii_unicode-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 474f5e83231a32526bb86682bbb930e4a29607bda55e992d53fdfbf1ff40e8d8
MD5 2fb633d020c71d48e49640404aac3e71
BLAKE2b-256 81952b2b21749625878fa892546bf653ef161167fafdcd976219e690b2c524dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for kannada_ascii_unicode-0.1.4-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