Rishe (ریشه): fast Persian text processing for Python, built in Rust
pip install rishe gives you Persian normalization, tokenization, sentence
splitting, lemmatization, ezafe detection and informal → formal conversion
from one Rust core: no models to download, prebuilt wheels for Linux, macOS
and Windows. The core is also available as a Rust crate.
- Normalization is ~70× faster than Hazm and Shekar; tokenization is on par with them. See docs/BENCHMARKS.md for the full numbers, including where Rishe loses.
Pipeline.pipe()processes batches in parallel (rayon) with the GIL released.
Status: alpha (0.1). Rishe is a fast preprocessing layer, not a replacement for Hazm or Shekar: there is no POS tagging, NER, parsing, spell checking or embeddings.
Install
pip install rishe # Python >= 3.9
or, from Rust (Cargo.toml): rishe = "0.1"
Quick start
from rishe import Pipeline
pipe = Pipeline()
doc = pipe("اون داره تو خونه کتاب میخونه، چیه؟")
doc.tokens # ['آن', 'دارد', 'تو', 'خانه', 'کتاب', 'میخواند', '،', 'چیست', '؟']
doc.lemmas # ['آن', 'داشت', 'تو', 'خانه', 'کتاب', 'خواند', '،', 'چیست', '؟']
doc.formal_text # 'آن دارد تو خانه کتاب میخواند، چیست؟'
doc.sentences, doc.normalized_text, doc.ezafe_markers
pipe.word_tokenize("سلام، دنیا!") # ['سلام', '،', 'دنیا', '!']
pipe.lemmatize("میروم") # 'رفت' (past-stem lemmas, UD style)
pipe.pipe(texts) # parallel batch -> list[ProcessedDoc]
use rishe::Pipeline;
let pipe = Pipeline::create(true, true, true); // unify digits, strip diacritics, fix ZWNJ
let doc = pipe.process("کتابهای خوب را به دوستانم میدهم.");
println!("{:?}", doc.tokens);
Known limitations
Pipeline.__call__also rewrites colloquial words to formal ones, sodoc.tokenscan differ from the surface text. Useword_tokenizefor plain tokenization.- Informal → formal conversion is lexicon- and rule-based. Common forms
(
اون,خونه,داره,چیه,میخوام) work; many suffixed or rarer forms (خونهام,کتابه) are left unchanged. - Lemmas follow the Universal Dependencies convention (verbs lemmatize to the past stem). Accuracy on UD is ~0.90 (Seraji) and ~0.88 (PerDT).
- Ezafe detection is rule-based and has not been evaluated.
Building from source
cargo test
maturin develop --release # Python extension into the current venv
python scripts/benchmark.py # needs: hazm shekar conllu
scripts/extract_lexicons.py regenerates data/*.tsv from Hazm's data
files; build.rs compiles them into FSTs.
License
Dual-licensed under Apache-2.0 or MIT, at your option. The bundled lexicons are derived from Hazm data (MIT); see NOTICE.md.
Metadata
Release files for rishe 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rishe-0.1.0.tar.gz | 1.0 MB | With provenance | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| rishe-0.1.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| rishe-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl | CPython 3.9 | abi3 | Linux musl 1.2+ x86-64 | Details |
| rishe-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl | CPython 3.9 | abi3 | Linux musl 1.2+ ARM64 | Details |
| rishe-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| rishe-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| rishe-0.1.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| rishe-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 9.5 MB
Release files / rishe-0.1.0.tar.gz
| Download URL | rishe-0.1.0.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43814242319cdde93d3a7d648ea5e4a39c5991ba46e1250c48c6c397c99eb99c
|
|
BLAKE2b-256 checksum How to use checksums |
7a838d3fbc948eb52827f87e6e10ad194551163c72d5890c0ffccdea37a48e46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / rishe-0.1.0-cp39-abi3-win_amd64.whl
| Download URL | rishe-0.1.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f04b6090ab97aa4e453bf67858ee9d594987198a4fd17242e0fe003268587168
|
|
BLAKE2b-256 checksum How to use checksums |
4e563be7e83cb4b885b4d263768a88569f04b804c05d69d12c830786f2400e15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / rishe-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | rishe-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7f06bc3cf6e41c916f5e9be855a498f7b7004be987eb54286b3196fb92cf5d60
|
|
BLAKE2b-256 checksum How to use checksums |
140f0ab151ce2670d2d8965fcc855e343a2026f3741beb90db71001dfd2d97a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / rishe-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | rishe-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.9 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ee5ab7e4be2475ddb7668422a0995820afb8b333545af8cb4c63f5ff63e09fbd
|
|
BLAKE2b-256 checksum How to use checksums |
2f6beb36b9385f602ac298ed8cd8cfa75413abb0888fa0a85033db6bf6daf1f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / rishe-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rishe-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
26d42dd915d6c5e68337ac90413aa3aa9b2e1f793c6a55fb0f5fe90d15ea0465
|
|
BLAKE2b-256 checksum How to use checksums |
47f3f180f2c47214fc043eb88b5af5acc8a005ea74fb32a35558623c4cd0ea16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / rishe-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rishe-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
fc4aafb937ef74ad70bb8dd21ad2a15f7513b74597694d0f4a46ea8cb38a95cd
|
|
BLAKE2b-256 checksum How to use checksums |
f41aa7e75a3538812c148427f7b8210a976d402447d05217d59cfc6ccd485779
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / rishe-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | rishe-0.1.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f20670d63150ce5ca98d4d7211a0f404a37a1e6a80ad90dd6c9af554b333d725
|
|
BLAKE2b-256 checksum How to use checksums |
65b70d0e27dda109ec76b022d05cc309dd2da0f09d026f1eccde4384c8915daf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / rishe-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | rishe-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
01950d315e19274a615e3f8acf9429f390db8e84bb23fc17e6a3ff0e294806eb
|
|
BLAKE2b-256 checksum How to use checksums |
c0685f61b5df9364fff604bd5a988f5ff960fb2894079be17c0ea8f50b0da075
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logSecurity for rishe 0.1.0
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.
Full provenance
All 8 files in this release have been uploaded with provenance metadata.
Attestation for rishe-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logA 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.