Pyfribidi for windows or any other bidi algorithm

I am trying to create a report using reportlab and the language of the report is Arabic. but the problem is that reportlab does not support BIDI display (Bidirection) due to the lack of support for the BIDI algorithm in Python. after many searches, I found that there is a wrapper around Gnome Fribidi called PyFribidi . but it compiled and works only on Linux, I tried to create it on Windows using mingwin, but the compilation failed because many Linux files were not found.

My question is: is there any python bidirectional Unicode implementation that works on Windows?

thank.

+4
source share
4 answers

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.

+1
source

python-bidi http://pypi.python.org/pypi/python-bidi/ - API- python, , -, .

RL reportlab pyfribidi python-bidi. http://code.pediapress.com/wiki/wiki/RightToLeft

+2

Here is another clean Python implementation for the Unicode bidi algorithm: http://code.google.com/p/pybidi/

+1
source

In the meantime, I implemented the formation of the Arabic language in Python:

https://github.com/behdad/pyarabicshaping

+1
source

All Articles