--- id: python-bidi version: "0.6.11" license: unclear license_treatment: copyleft maintenance: active --- # python-bidi — Python Bidi layout wrapping the Rust crate unicode-bidi License: copyleft · Maintenance: active · Downloads: 11.3M/mo ## What it is and what it does Python BiDi solves the problem of displaying bidirectional text—text that mixes left-to-right scripts (like English) with right-to-left scripts (like Hebrew or Arabic). It implements the Unicode Bidirectional Algorithm to reorder characters into their correct visual display sequence. The package offers two implementations: a pure Python version (V5 of the algorithm) and a newer Rust-based wrapper around the unicode-bidi crate, which implements a higher version of the algorithm. You use it by passing a string or bytes to `get_display()`, optionally specifying encoding, base direction, or debug output. It returns the text in display order, ready for rendering. The package also includes a command-line tool (`pybidi`) for processing text files or stdin. It has no runtime dependencies and supports Python 3.9 through 3.14, with precompiled wheels for most platforms. Use it for: - Render mixed Hebrew and English text correctly in web applications or documents. - Process Arabic text in data pipelines where visual order is required for display. - Build text editors or terminal utilities that handle bidirectional scripts. - Convert stored Unicode text to display order before passing to rendering engines. - Debug bidirectional text layout issues with the debug flag to inspect Unicode levels. - Command-line text processing for files containing right-to-left scripts. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts bidirectional text (mixed left-to-right and right-to-left scripts) into display order for rendering, with both Python and Rust implementations available. Yes. The package is actively maintained, has no known vulnerabilities, zero runtime dependencies, and solves a specific and well-defined problem in text rendering. Install it if you need to display bidirectional text; the LGPL license is standard for text-processing libraries and poses no barrier for most projects. The Rust implementation path offers better algorithm coverage for new code. ## Install pip install python-bidi uv add python-bidi poetry add python-bidi ## Installing python-bidi Before you install: Medium install friction due to precompiled wheels for multiple platforms and Python versions (3.9–3.14), but no runtime dependencies. Last release 45 days ago; repository active with 126 stars and recent commits. License in practice: Licensed under LGPL (copyleft); derivative works and modifications must be distributed under compatible terms. Suitable for open-source projects but requires careful review for proprietary use. Quickstart: pip install python-bidi from bidi import get_display result = get_display('שלום') # Hebrew text print(result) # Displays in correct visual order Verify before relying: - Whether the Rust implementation covers all Unicode Bidirectional Algorithm versions or has known gaps beyond what issue #25 documents. - Performance characteristics and memory overhead when processing large volumes of mixed-script text. - Compatibility with non-UTF-8 encodings in production scenarios. ## Package facts - License: not declared (copyleft) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 11.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags bidirectional text layout, bidi algorithm implementation, right-to-left text rendering, unicode text direction, mixed script display order, hebrew arabic text layout, bidi display conversion, unicode-text, bidi-layout, text-rendering [View on SkillFed](https://skillfed.io/packages/python-bidi) · [View on PyPI](https://pypi.org/project/python-bidi/)