This is python version of anvaad-js
Hosted on Pypi - anvaad-py
# pip
pip install anvaad-py //for windows
pip3 install anvaad-py //for mac
from anvaad_py import unicode
result = unicode('ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥', True)
print(result)
// => 'Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]'
Returns a comma-separated string of ascii codes for a string of Gurmukhi characters
Parameters
string
The string of letters
Examples
from anvaad_py import ascii
result = ascii('AmgAmqmgkp')
print(result)
// => ',065,109,103,065,109,113,109,103,107,112,'
string
Returns a single string of comma-separated ascii codes
Retrieve the first letter of each word from a string
Parameters
words
string The string from which to get first letterseng
boolean Whether the string is English (optional, defaultfalse
)simplify
boolean Whether to simplify embedded vowels and other characters (eg. E to a, ^ to K)
Examples
from anvaad_py import firstLetters
result = firstLetters('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
print(result)
// => 'AmgAmqmgkp'
string
Returns a single string of characters
Removes vowel symbols from a Gurmukhi string
Parameters
words
string The string from which to get main letterssimplify
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
from anvaad_py import mainLetters
result = mainLetters('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
print(result)
// => 'Ae ml grsK Ae ml q mr gr k pAr'
string
Returns a single string of characters
Convert Gurmukhi script to Unicode and back again.
Parameters
text
string Gurbani Akhar or Unicode script to be convertedreverse
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
from anvaad_py import unicode
gurmukhiResult = unicode('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
print(f"gurmukhi results: {gurmukhiResult}")
// => 'gurmukhi results: ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥'
Returns string Returns unicode text
from anvaad_py import unicode
unicodeResult = unicode('ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥', True)
print(f"unicode results: {unicodeResult}")
* // => 'unicode results: Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]'
string
Returns gurbani akhar ascii text
a 0xharkirat (Harkirat Singh) production.