PersianConverter


NamePersianConverter JSON
Version 1.0.11 PyPI version JSON
download
home_pagehttps://github.com/komeylian/PersianConverter
SummaryA package for converting Persian text
upload_time2023-06-30 16:43:16
maintainer
docs_urlNone
authorHamidreza Komeylian
requires_python>=3.6
licenseMIT
keywords persian text conversion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            A package for converting Persian text. This package provides functions to reshape and display Persian text.

# PersianConverter

[![PyPI version](https://img.shields.io/pypi/v/PersianConverter.svg)](https://pypi.org/project/PersianConverter/)
[![License](https://img.shields.io/pypi/l/PersianConverter.svg)](https://github.com/your_username/PersianConverter/blob/main/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:

```shell
pip install PersianConverter
```

## Usage

Here's an example of how to use PersianConverter:

```python
from persian_converter import fprint

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

```python
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 به شرح ذیل استفاده کنید :

```shell
pip install PersianConverter
```



## نمونه کد استفاده:
```python
from persian_converter import fprint

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


```python
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.

   
    

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/komeylian/PersianConverter",
    "name": "PersianConverter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Persian,text conversion",
    "author": "Hamidreza Komeylian",
    "author_email": "komeylian@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0c/ac/f66c0bfeece66e161269fd19012c5c928a46e88ec61d6c35df6b13e3152b/PersianConverter-1.0.11.tar.gz",
    "platform": null,
    "description": "A package for converting Persian text. This package provides functions to reshape and display Persian text.\r\n\r\n# PersianConverter\r\n\r\n[![PyPI version](https://img.shields.io/pypi/v/PersianConverter.svg)](https://pypi.org/project/PersianConverter/)\r\n[![License](https://img.shields.io/pypi/l/PersianConverter.svg)](https://github.com/your_username/PersianConverter/blob/main/LICENSE)\r\n\r\nPersianConverter 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.\r\n\r\n## Installation\r\n\r\nYou can install PersianConverter using pip:\r\n\r\n```shell\r\npip install PersianConverter\r\n```\r\n\r\n## Usage\r\n\r\nHere's an example of how to use PersianConverter:\r\n\r\n```python\r\nfrom persian_converter import fprint\r\n\r\ntext = \"\u0633\u0644\u0627\u0645 \u0645\u0646 \u06a9\u0645\u06cc\u0644\u06cc\u0627\u0646 \u0647\u0633\u062a\u0645\"\r\nconverted_text = fprint(text)\r\nprint(converted_text)\r\n```\r\n\r\n```python\r\nfrom persian_converter import fprint\r\n\r\ndef display_number(number):\r\n    \"\"\"\r\n    Function display_number: This function takes a number as input and converts it to Persian text,\r\n    then prints the converted number.\r\n    \"\"\"\r\n    converted_number = fprint(number)\r\n    print(converted_number)\r\n\r\nnumbers = [\"\u06cc\u06a9\", \"\u062f\u0648\", \"\u0633\u0647\"]\r\n\r\nfor number in numbers:\r\n    # Calling the display_number function to display the converted number\r\n    display_number(number)\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nThis will output the text in a properly reshaped and bidirectionally aligned format.\r\n\r\n## How It Works\r\nPersianConverter 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.\r\n\r\nFor more information and detailed documentation, please refer to the documentation (in Persian).\r\n\r\n\r\n\r\n# \u0646\u0635\u0628 \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 PersianConverter\r\n\r\n\r\n\r\n## \u0646\u062d\u0648\u0647 \u0646\u0635\u0628 \r\n\r\n\u0628\u0627\u0631 \u0646\u0635\u0628 \u0627\u0631 \u062f\u0633\u062a\u0648\u0631 pip \u0628\u0647 \u0634\u0631\u062d \u0630\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f :\r\n\r\n```shell\r\npip install PersianConverter\r\n```\r\n\r\n\r\n\r\n## \u0646\u0645\u0648\u0646\u0647 \u06a9\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647:\r\n```python\r\nfrom persian_converter import fprint\r\n\r\ntext = \"\u0633\u0644\u0627\u0645 \u0645\u0646 \u06a9\u0645\u06cc\u0644\u06cc\u0627\u0646 \u0647\u0633\u062a\u0645\"\r\nconverted_text = fprint(text)\r\nprint(converted_text)\r\n```\r\n\r\n\r\n```python\r\nfrom persian_converter import fprint\r\n\r\ndef display_number(number):\r\n    \"\"\"\r\n    \u062a\u0627\u0628\u0639 display_number: \u0627\u06cc\u0646 \u062a\u0627\u0628\u0639 \u06cc\u06a9 \u0639\u062f\u062f \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0622\u0646 \u0631\u0627 \u062a\u0628\u062f\u06cc\u0644 \u0628\u0647 \u0641\u0627\u0631\u0633\u06cc \u0645\u06cc\u200c\u06a9\u0646\u062f\u060c\r\n    \u0633\u067e\u0633 \u0639\u062f\u062f \u062a\u0628\u062f\u06cc\u0644 \u0634\u062f\u0647 \u0631\u0627 \u0686\u0627\u067e \u0645\u06cc\u200c\u06a9\u0646\u062f.\r\n    \"\"\"\r\n    converted_number = fprint(number)\r\n    print(converted_number)\r\n\r\nnumbers = [\"\u06cc\u06a9\", \"\u062f\u0648\", \"\u0633\u0647\"]\r\n\r\nfor number in numbers:\r\n    # \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u062a\u0627\u0628\u0639 display_number \u0628\u0631\u0627\u06cc \u0646\u0645\u0627\u06cc\u0634 \u0639\u062f\u062f \u062a\u0628\u062f\u06cc\u0644 \u0634\u062f\u0647\r\n    display_number(number)\r\n\r\n```\r\n\r\n\r\n\r\n## \u0628\u0631\u0627\u06cc \u062a\u0628\u062f\u06cc\u0644 \u0645\u062a\u0646 \u0641\u0627\u0631\u0633\u06cc \u0648 \u0646\u0645\u0627\u06cc\u0634 \u0622\u0646 \u0628\u0627 \u0642\u0627\u0644\u0628 \u0645\u0646\u0627\u0633\u0628 \u0648 \u062a\u0631\u062a\u06cc\u0628 \u0635\u062d\u06cc\u062d\u060c \u0627\u0632 \u0627\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f.\r\n\r\n\u062c\u0647\u062a \u0645\u0637\u0627\u0644\u0639\u0647 \u0648 \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u06cc\u0634\u062a\u0631\u060c \u0628\u0647 \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0645\u0631\u0627\u062c\u0639\u0647 \u06a9\u0646\u06cc\u062f.\r\n\r\n\r\n## Feel free to customize and enhance the text according to your specific needs and preferences.\r\n\r\n   \r\n    \r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package for converting Persian text",
    "version": "1.0.11",
    "project_urls": {
        "Homepage": "https://github.com/komeylian/PersianConverter"
    },
    "split_keywords": [
        "persian",
        "text conversion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f3b481f482ce97390a1d15c38b68729da5532855528d18ae66e47619151b3a3a",
                "md5": "fa4903923c3e637bbef9f5d1c65ed58a",
                "sha256": "e7cf4053ae74d61c4d2383e23a03a50762bf3aa1044173c555baf2b1b8699f53"
            },
            "downloads": -1,
            "filename": "PersianConverter-1.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fa4903923c3e637bbef9f5d1c65ed58a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 3530,
            "upload_time": "2023-06-30T16:43:14",
            "upload_time_iso_8601": "2023-06-30T16:43:14.593706Z",
            "url": "https://files.pythonhosted.org/packages/f3/b4/81f482ce97390a1d15c38b68729da5532855528d18ae66e47619151b3a3a/PersianConverter-1.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0cacf66c0bfeece66e161269fd19012c5c928a46e88ec61d6c35df6b13e3152b",
                "md5": "2b405ad7411cd4f950e62d8a48541b5d",
                "sha256": "d00d2f1fb1995bcd2c9806bfe03257d026a052c6189e2d47fe27edead505627e"
            },
            "downloads": -1,
            "filename": "PersianConverter-1.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "2b405ad7411cd4f950e62d8a48541b5d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 2838,
            "upload_time": "2023-06-30T16:43:16",
            "upload_time_iso_8601": "2023-06-30T16:43:16.347375Z",
            "url": "https://files.pythonhosted.org/packages/0c/ac/f66c0bfeece66e161269fd19012c5c928a46e88ec61d6c35df6b13e3152b/PersianConverter-1.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-30 16:43:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "komeylian",
    "github_project": "PersianConverter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "persianconverter"
}
        
Elapsed time: 1.20379s