Skip to main content

A package for converting Persian text

Project description

A package for converting Persian text. This package provides functions to reshape and display Persian text.

PersianConverter

PyPI version License

PersianConverter is a Python package for converting Persian text. It provides functions to reshape Persian text, apply the bidirectional algorithm, and display Persian text using proper presentation forms.

Installation

You can install PersianConverter using pip:

pip install PersianConverter

Usage

Here's an example of how to use PersianConverter:

from persian_converter import fprint

text = "سلام من کمیلیان هستم"
converted_text = fprint(text)
print(converted_text)
from persian_converter import fprint

def display_number(number):
    """
    Function display_number: This function takes a number as input and converts it to Persian text,
    then prints the converted number.
    """
    converted_number = fprint(number)
    print(converted_number)

numbers = ["یک", "دو", "سه"]

for number in numbers:
    # Calling the display_number function to display the converted number
    display_number(number)

This will output the text in a properly reshaped and bidirectionally aligned format.

How It Works

PersianConverter utilizes the arabic_reshaper and python-bidi libraries to reshape and display Persian text. It takes input text in Persian and applies reshaping and bidirectional algorithms to ensure the correct rendering of the text.

For more information and detailed documentation, please refer to the documentation (in Persian).

نصب و استفاده از کتابخانه PersianConverter

نحوه نصب

بار نصب ار دستور pip به شرح ذیل استفاده کنید :

pip install PersianConverter

نمونه کد استفاده:

from persian_converter import fprint

text = "سلام من کمیلیان هستم"
converted_text = fprint(text)
print(converted_text)
from persian_converter import fprint

def display_number(number):
    """
    تابع display_number: این تابع یک عدد را دریافت می‌کند و آن را تبدیل به فارسی می‌کند،
    سپس عدد تبدیل شده را چاپ می‌کند.
    """
    converted_number = fprint(number)
    print(converted_number)

numbers = ["یک", "دو", "سه"]

for number in numbers:
    # فراخوانی تابع display_number برای نمایش عدد تبدیل شده
    display_number(number)

برای تبدیل متن فارسی و نمایش آن با قالب مناسب و ترتیب صحیح، از این کتابخانه استفاده می‌شود.

جهت مطالعه و مستندات بیشتر، به مستندات مراجعه کنید.

Feel free to customize and enhance the text according to your specific needs and preferences.

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

PersianConverter-1.0.11.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

PersianConverter-1.0.11-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file PersianConverter-1.0.11.tar.gz.

File metadata

  • Download URL: PersianConverter-1.0.11.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for PersianConverter-1.0.11.tar.gz
Algorithm Hash digest
SHA256 d00d2f1fb1995bcd2c9806bfe03257d026a052c6189e2d47fe27edead505627e
MD5 2b405ad7411cd4f950e62d8a48541b5d
BLAKE2b-256 0cacf66c0bfeece66e161269fd19012c5c928a46e88ec61d6c35df6b13e3152b

See more details on using hashes here.

File details

Details for the file PersianConverter-1.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for PersianConverter-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e7cf4053ae74d61c4d2383e23a03a50762bf3aa1044173c555baf2b1b8699f53
MD5 fa4903923c3e637bbef9f5d1c65ed58a
BLAKE2b-256 f3b481f482ce97390a1d15c38b68729da5532855528d18ae66e47619151b3a3a

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