--- id: arabic-reshaper version: "3.0.1" license: MIT license_treatment: permissive maintenance: active --- # arabic-reshaper — Reconstruct Arabic sentences to be used in applications that do not support Arabic License: permissive · Maintenance: active · Downloads: 5.5M/mo ## What it is and what it does Arabic Reshaper solves a core rendering problem: Arabic script characters change shape based on their position in a word (initial, medial, final, or isolated), but many applications and libraries don't handle this automatically. This library takes Arabic text and replaces each character with its correct contextual form, making it displayable in systems without native Arabic support. The package works alongside the Unicode bidirectional algorithm (typically via python-bidi) to handle both character shaping and text direction. It offers fine-grained configuration for ligature support, diacritical mark handling, and font-specific behavior, making it suitable for diverse use cases from simple text processing to image rendering with PIL. Use it for: - Render Arabic text on images using PIL when the font doesn't handle shaping automatically. - Prepare Arabic text for display in web frameworks or libraries that lack right-to-left and shaping support. - Process Arabic user input for storage or display in legacy systems without Arabic rendering capability. - Generate correctly shaped Arabic text for PDF generation or document export. - Support Farsi or Urdu text in applications originally designed for left-to-right scripts. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Reshapes Arabic text characters into their correct contextual forms for display in applications that don't natively support Arabic script rendering. Yes. The package solves a real, narrow problem with no runtime dependencies, active maintenance, and permissive licensing. Install it if you need to display Arabic, Farsi, or Urdu text in an application or library that doesn't natively support Arabic script shaping. Skip it if your rendering stack already handles Arabic natively. ## Install pip install arabic-reshaper uv add arabic-reshaper poetry add arabic-reshaper ## Installing arabic-reshaper Before you install: Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent releases; last commit 2026-04-28 and repository not archived. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal attribution requirements. Quickstart: pip install arabic-reshaper import arabic_reshaper text_to_be_reshaped = 'اللغة العربية رائعة' reshaped_text = arabic_reshaper.reshape(text_to_be_reshaped) Requires Python 3.10 or later. Optional: fonttools library needed only if using config_for_true_type_font feature. Verify before relying: - Whether harakat (diacritical marks) handling is correct in all edge cases when combined with bidi reversal. - Performance characteristics with very large text volumes or real-time rendering scenarios. - Compatibility with all Arabic script variants (Farsi, Urdu) claimed in documentation. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 5.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags arabic text reshaping, arabic character shaping, arabic script rendering, arabic ligature support, right-to-left text processing, arabic unicode normalization, arabic harakat handling, arabic-script, text-rendering, internationalization [View on SkillFed](https://skillfed.io/packages/arabic-reshaper) · [View on PyPI](https://pypi.org/project/arabic-reshaper/)