Python BiDi - excellent BiDi algorithm implementation, but it just supports bidirectional (As Is) without fixing the contextual form of Arabic script, to solve the problem of the content form, you have to use python-bidi module with Arab reshaper library named for python-arabic-reshaper .
example: (from => http://mpcabd.igeex.biz/python-arabic-text-reshaper/ )
import arabic_reshaper
from bidi.algorithm import get_display
reshaped_text = arabic_reshaper.reshape(u'اللغة العربية رائعة')
bidi_text = get_display(reshaped_text)
pass_arabic_text_to_render(bidi_text)
it fixes my problem perfectly and both packages are a pure python implementation.
source
share