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
stringstring 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
wordsstring The string from which to get first lettersengboolean Whether the string is English (optional, defaultfalse)simplifyboolean 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
wordsstring The string from which to get main letterssimplifyboolean Whether to simplify embedded vowels/nasal sounds (eg. E to a, ^ to K)simplifyConsonantsboolean 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
textstring Gurbani Akhar or Unicode script to be convertedreverseboolean Whether to convert ASCII to unicode (false by default)simplifyboolean 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anvaad_py-0.0.7.tar.gz.
File metadata
- Download URL: anvaad_py-0.0.7.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d198bd27a02a9ccd0e1d72847dadbbd83dabbcb7bc40d077ae6c73d7cd5bdf1d
|
|
| MD5 |
85abbc7e6981557ca09137970fcb2ed0
|
|
| BLAKE2b-256 |
3c15651525aac1891ef51360ebb6631d3d5ec44e2ac3074ebc1103bdbe59c3b7
|
File details
Details for the file anvaad_py-0.0.7-py3-none-any.whl.
File metadata
- Download URL: anvaad_py-0.0.7-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e2c476ab224dfaa83b3dfa15b4cfaff24b3029939b62185722365017cb15fea
|
|
| MD5 |
941a5c4c8363e58b05080015e86bb0a9
|
|
| BLAKE2b-256 |
477d921e92e9e9897a82f571fcec02056cdda28a9d50b21406e518952ed4fab6
|