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 Common errors
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(...)'.
Warnings
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.
Imports
- arabic_normalize wrong
from pyarabic import arabic_normalizecorrectfrom pyarabic import araby - Araby wrong
import arabycorrectimport pyarabic.araby as araby
Quickstart
import pyarabic.araby as araby
text = 'السلام عليكم'
normalized = araby.strip_tashkeel(text)
print(normalized)