python-bidi
Python Bidi layout wrapping the Rust crate unicode-bidi
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 on this page — 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
python-bidi on PyPI
pip
pip install python-bidiuv
uv add python-bidipoetry
poetry add python-bidiInstalling 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 the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 45 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,274,418/month — #1,402 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_bidi-0.6.11-cp310-cp310-macosx_10_12_x86_64.whl; python_bidi-0.6.11-cp310-cp310-macosx_11_0_arm64.whl; python_bidi-0.6.11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; python_bidi-0.6.11-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; python_bidi-0.6.11-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; python_bidi-0.6.11-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; python_bidi-0.6.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_bidi-0.6.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; python_bidi-0.6.11-cp310-cp310-musllinux_1_2_aarch64.whl; python_bidi-0.6.11-cp310-cp310-musllinux_1_2_armv7l.whl; python_bidi-0.6.11-cp310-cp310-musllinux_1_2_i686.whl; python_bidi-0.6.11-cp310-cp310-musllinux_1_2_x86_64.whl; python_bidi-0.6.11-cp310-cp310-win32.whl; python_bidi-0.6.11-cp310-cp310-win_amd64.whl; python_bidi-0.6.11-cp311-cp311-macosx_10_12_x86_64.whl; python_bidi-0.6.11-cp311-cp311-macosx_11_0_arm64.whl; python_bidi-0.6.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; python_bidi-0.6.11-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; python_bidi-0.6.11-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; python_bidi-0.6.11-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl
Keywords: bidi, unicode, layout
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
arabic-reshaperReshapes Arabic text characters into their…
permissive · top 5,000 on PyPI
bidictProvides a bidirectional dictionary (bidict)…
copyleft · top 1,000 on PyPI
cyrtranslitConverts text between Cyrillic and Latin…
permissive · top 15,000 on PyPI
transliterateConverts text between Latin and non-Latin…
copyleft · top 15,000 on PyPI
mikeshardmind-base2048Encodes binary data into text using base2048, a…
copyleft · top 15,000 on PyPI
databento-dbndatabento-dbn provides Python bindings for…
permissive · top 5,000 on PyPI
idnaConverts domain names between Unicode and…
permissive · top 100 on PyPI
unicode-segmentation-rsProvides Unicode text segmentation (graphemes,…
unclear · top 15,000 on PyPI
win_unicode_consoleFixes Unicode input and display in Python when…
permissive · top 15,000 on PyPI
pansiPansi provides a clean interface for rendering…
permissive · top 15,000 on PyPI