A simple Python library for Persian language localization.
Python implementation of Persian.js
pip install persianUsed for converting Arabic characters to Persian.
Example:
persian.convert_ar_characters("علي") #returns: علیUsed for converting Persian numbers to English.
Example:
persian.convert_fa_numbers("۱۳۷۱") #returns: 1371Used for converting Arabic numbers to Persian.
Example:
persian.convert_ar_numbers("٣٤٥") #returns: ۳۴۵Used for converting English numbers to Persian.
Example:
persian.convert_en_numbers("345") #returns: ۳۴۵Converting Persian char to English char by switching the keyboard layout
Example:
persian.convert_en_characters("sghl") #returns: سلامExample:
persian.convert_en_characters("آمده ای ولی من رفته ام و می آییم") #returns: آمدهای ولی من رفتهام و میآییمExample:
persian.decode_url("https://fa.wikipedia.org/wiki/%D8%B5%D9%81%D8%AD%D9%87%D9%94_%D8%A7%D8%B5%D9%84%DB%8C") #returns: https://fa.wikipedia.org/wiki/صفحهٔ_اصلیThis is a open-source project. Fork the project, complete the code and send pull request.