A simple Python library for Persian language localization.
Python package like Persian.js
pip install persian
import persian
Converting Arabic characters to Persian.
Example:
persian.convert_ar_characters("علي") #returns: علی
Converting Arabic numbers to Persian.
Example:
persian.convert_ar_numbers("٣٤٥") #returns: ۳۴۵
Converting Persian numbers to English numbers
Example:
persian.convert_fa_numbers("۱۳۷۱") #returns: 1371
Converting English numbers to Persian.
Example:
persian.convert_en_numbers("345") #returns: ۳۴۵
Converting Persian char to English char.
Example:
persian.convert_en_characters("sghl") #returns: سلام
This is a open-source project. Fork the project, complete the code and send pull request.
python setup.py test
python -m unittest test/test_persian.py