or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/python-bidi@0.6.x
tile.json

tessl/pypi-python-bidi

tessl install tessl/pypi-python-bidi@0.6.0

Python Bidi layout wrapping the Rust crate unicode-bidi

Agent Success

Agent success rate when using this tile

93%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.09x

Baseline

Agent success rate without this tile

85%

task.mdevals/scenario-5/

Bidirectional Text Display Formatter

A utility that converts logical bidirectional text into its proper visual display order for user interfaces that display mixed left-to-right (LTR) and right-to-left (RTL) text.

Capabilities

Basic RTL Text Display

Converts right-to-left text from logical storage order to visual display order.

  • Given the Hebrew string "שלום", returns "םולש" @test
  • Given the mixed text "car is THE CAR", returns appropriate display order @test

Mixed Script Handling

Handles text containing both LTR and RTL scripts with numbers.

  • Given "1 2 3 ניסיון", returns "ןויסינ 3 2 1" @test

Encoding Support

Processes text in different character encodings.

  • Given UTF-8 encoded bytes containing "שלום", returns bytes with text in display order @test

Implementation

@generates

API

def format_for_display(text, encoding='utf-8'):
    """
    Converts bidirectional text to display order.

    Args:
        text: Input text as str or bytes
        encoding: Character encoding for bytes input (default: 'utf-8')

    Returns:
        Text in visual display order, same type as input (str or bytes)
    """
    pass

Dependencies { .dependencies }

python-bidi { .dependency }

Provides bidirectional text algorithm implementation for converting logical text order to visual display order.

@satisfied-by