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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

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

Hashes for anvaad_py-0.0.7.tar.gz
Algorithm Hash digest
SHA256 d198bd27a02a9ccd0e1d72847dadbbd83dabbcb7bc40d077ae6c73d7cd5bdf1d
MD5 85abbc7e6981557ca09137970fcb2ed0
BLAKE2b-256 3c15651525aac1891ef51360ebb6631d3d5ec44e2ac3074ebc1103bdbe59c3b7

See more details on using hashes here.

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

Hashes for anvaad_py-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5e2c476ab224dfaa83b3dfa15b4cfaff24b3029939b62185722365017cb15fea
MD5 941a5c4c8363e58b05080015e86bb0a9
BLAKE2b-256 477d921e92e9e9897a82f571fcec02056cdda28a9d50b21406e518952ed4fab6

See more details on using hashes here.

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