Skip to main content

An ASCII to Unicode text converter for 'FM Abhaya' Sinhala font, with extensibility for other fonts via JSON mappings.

Project description

Pandukabhaya

Pandukabhaya is an ASCII to Unicode text converter. Currently, it only supports the 'FM Abhaya' ASCII Sinhala font, but other font mappings will be added in the future. Pandukabhaya is written as a generic text conversion tool that uses JSON mappings to transform text. Therefore, it can be used to convert any text given the mapping.

Name

The most famous Sinhala ASCII font is 'FM Abhaya' named after King Abhaya (474 BCE to 454 BCE). The tool is named after his nephew, who was named after King Abhaya and King Panduvasdeva. Pandukabhaya accended to the throne replacing Abhaya (technically Tissa succeeded to the throne right after Abhaya. But we chose the most notable successor 😀)

Features

  • A iteratively generated mapping file for 'FM Abhaya' font.
  • Loads mappings from JSON files for flexibility.
  • Command-line interface for quick and easy usage.

Installation

Package is pending release in Pypi. For now clone the repository and install from the clone.

pip install pandukabhaya

Usage

As a CLI Tool

pandukabhaya <mapping_name> -t <text>
pandukabhaya <mapping_name> -t <text> -o <output_file>
pandukabhaya <mapping_name> -i <input_file> -o <output_file>

As a Python Module

from pandukabhaya import Converter

converter = Converter("fm_abhaya")
output = converter.convert("rkaosl")
print(output)

Run tests

python -m unittest tests.test_converter

Folder Structure and Explanations

PANDUKABHAYA/
├── pandukabhaya/
│   ├── cli.py
│   ├── converter.py
│   └── mappings/
│       └── fm_abhaya.json
├── scripts/
│   ├── generation.ipynb
│   └── prep.ipynb
└── tests/
    ├── test_cases.json
    └── test_converter.py
  • pandukabhaya/: Core package directory containing the simple code modules (cli.py, converter.py)
    • mappings/: Contains mapping files.
  • scripts/: Contains Jupyter notebooks and mapping files for data analysis, preparation, and generation processes.
    • prep.ipynb - Cleans and corrects the UCSC mapping file.
    • generation.ipynb - Using improved UCSC mappings as a guide, generates mappings iteratively
  • tests/: Contains unit test scripts and test data to ensure code quality and functionality.

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

pandukabhaya-1.0.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

pandukabhaya-1.0.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file pandukabhaya-1.0.1.tar.gz.

File metadata

  • Download URL: pandukabhaya-1.0.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pandukabhaya-1.0.1.tar.gz
Algorithm Hash digest
SHA256 924a7af7d0b752a46ef4ea5bfab4cd344cb283267faefbf192752c3fde4d275f
MD5 dcb1f4a601cbe720808bd07b2160f177
BLAKE2b-256 3b694dda221838bd19c9c50250226d0425ff63f0ab39ab98a0f2a9f5b072da10

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandukabhaya-1.0.1.tar.gz:

Publisher: publish.yml on akuruAI/Pandukabhaya

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

File details

Details for the file pandukabhaya-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pandukabhaya-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pandukabhaya-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e27217b895b42d7816d8b8abf3bd45ac76505d456c91f1144eb958f9f1488f4
MD5 6db8a4eec0fe10c61ec9ca76a3a8ff50
BLAKE2b-256 78123e0d5d1270bb6e474286e3f1ebd4bd9d9879f8f319803a4874a18284ebdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandukabhaya-1.0.1-py3-none-any.whl:

Publisher: publish.yml on akuruAI/Pandukabhaya

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