Skip to main content

A Python utility to translit gurmukhi, and convert it between ascii to unicode with ease! (Python version of anvaad-js)

Project description

anvaad-py :: ਅਨੁਵਾਦ-ਪੀਵਾਏ

This is python version of anvaad-js

Installation

# pip
pip install anvaad-py

API Documentation

Usage

import unicode from anvaad_py

unicode('ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥', True)
// => 'Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]'

Table of Contents

ascii

Returns a comma-separated string of ascii codes for a string of Gurmukhi characters

Parameters

  • string string The string of letters

Examples

ascii('AmgAmqmgkp')
// => ',065,109,103,065,109,113,109,103,107,112,'

Returns string Returns a single string of comma-separated ascii codes

firstLetters

Retrieve the first letter of each word from a string

Parameters

  • words string The string from which to get first letters
  • eng boolean Whether the string is English (optional, default false)
  • simplify boolean Whether to simplify embedded vowels and other characters (eg. E to a, ^ to K)

Examples

firstLetters('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
// => 'AmgAmqmgkp'

Returns string Returns a single string of characters

mainLetters

Removes vowel symbols from a Gurmukhi string

Parameters

  • words string The string from which to get main letters
  • simplify boolean Whether to simplify embedded vowels/nasal sounds (eg. E to a, ^ to K)
  • simplifyConsonants boolean Whether to simplify half characters to full characters (eg. R to r)

Examples

mainLetters('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
// => 'Ae ml grsK Ae ml q mr gr k pAr'

Returns string Returns a single string of characters

unicode

Convert Gurmukhi script to Unicode and back again.

Parameters

  • text string Gurbani Akhar or Unicode script to be converted
  • reverse boolean Whether to convert ASCII to unicode (false by default)
  • simplify boolean Whether to simplify extended characters to single code points (eg. sæ to ਸ਼ (u0A36), ਸ਼ (u0A38u0A3C) to S) (false by default)

Examples

unicode('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
// => 'ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥'

Returns string Returns unicode text

 * unicode('ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥', True)
 * // => 'Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]'

Returns string Returns gurbani akhar ascii text

a 0xharkirat (Harkirat Singh) production.

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

anvaad_py-0.0.7.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

anvaad_py-0.0.7-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

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