import arabic_reshaper from bidi.algorithm import get_display def formatArabicSentences(sentences): formatedSentences = arabic_reshaper.reshape(sentences) return get_display(formatedSentences)