Skip to main content

alt text alt text

Farsi Tools: tools for processing Farsi (Persian) text

Tested with:

  • Python 3.5+

Use the following command to install using pip:

pip install farsi-tools

Usage example

Converting digits

Use replace_arabic_digits_with_farsi method to replace arabic digits with farsi digits.

from farsi_tools import replace_arabic_digits_with_farsi

replace_arabic_digits_with_farsi('٤')  # returns ۴

Use replace_ascii_digits_with_farsi method to replace ASCII digits with farsi digits.

from farsi_tools import replace_ascii_digits_with_farsi

replace_ascii_digits_with_farsi('4')  # returns ۴

Use replace_farsi_digits_with_ascii method to replace farsi digits with ASCII digits.

from farsi_tools import replace_farsi_digits_with_ascii

replace_farsi_digits_with_ascii('۴')  # returns 4

Use replace_arabic_digits_with_ascii method to replace farsi digits with ASCII digits.

from farsi_tools import replace_arabic_digits_with_ascii

replace_arabic_digits_with_ascii('٤')  # returns 4

Convert text to Farsi (Persian)

Use standardize_persian_text method to convert characters to standard persian form

from farsi_tools import standardize_persian_text

standardize_persian_text('سلام خوبي؟ کمك ﻧميخواي؟') # returns "سلام خوبی؟ کمک نمیخوای؟"

Get Farsi (Persian) stop-words

Use stopwords method to retrieve list of persian stop-words

from farsi_tools import stop_words

stop_words()

Metadata

Release files for farsi-tools 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for farsi-tools 0.2
File Size Uploaded Provenance
farsi_tools-0.2.tar.gz 13.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for farsi-tools 0.2
File Interpreter ABI Platform
farsi_tools-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / farsi_tools-0.2.tar.gz

Download URL farsi_tools-0.2.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
afe7b0bb0c8f5fcab7464d63568552fea6440ed5a04850df26913e9b4abb018d
BLAKE2b-256 checksum
How to use checksums
85d33fdd1844fe682ca9665594d2ba79a6bf17ee9ec42a21ecebcb7986a69176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

Release files / farsi_tools-0.2-py3-none-any.whl

Download URL farsi_tools-0.2-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9396dcbc6219754b570f893663e31b83aa10ba8c5916b361445b66584beb7e50
BLAKE2b-256 checksum
How to use checksums
50ffc431144c6d579c0549e1899bcbd7ec9ab2d08566e198b7df8ad0ac1eeb30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

Security for farsi-tools 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page