PyArabic

raw JSON →
0.6.15 verified Mon Apr 27 auth: no python

Arabic text processing library for Python (v0.6.15). Provides utilities for Arabic string manipulation, including character detection, normalization, stemming, and conversion to Buckwalter transliteration. Currently in maintenance mode with infrequent releases.

pip install pyarabic
error ModuleNotFoundError: No module named 'araby'
cause Attempted direct import of 'araby' instead of 'pyarabic.araby'.
fix
Run 'pip install pyarabic' and use 'import pyarabic.araby as araby'.
error AttributeError: module 'pyarabic' has no attribute 'strip_tashkeel'
cause Trying to call function directly on pyarabic instead of the araby submodule.
fix
Use 'pyarabic.araby.strip_tashkeel(...)' or 'import pyarabic.araby as araby; araby.strip_tashkeel(...)'.
gotcha The main module is named 'araby', not 'pyarabic' directly. Import via 'import pyarabic.araby as araby'.
fix Use 'import pyarabic.araby as araby'.
gotcha Many functions expect Unicode strings, not byte strings. Passing bytes will raise TypeError.
fix Ensure all inputs are str (Unicode) in Python 3.
deprecated The module 'pyarabic.soundex' is deprecated and may be removed in future versions.
fix Use alternative soundex implementations like 'arabic_soundex' package.

Basic usage: import the araby module and use its functions.

import pyarabic.araby as araby
text = 'السلام عليكم'
normalized = araby.strip_tashkeel(text)
print(normalized)