Skip to main content

A Python library to print Arabic text with proper bidirectional support

Project description

Print Arabic

Twitter Follow Downloads PyPI - Python Version PyPI version

A Python library to print Arabic text with proper bidirectional support in terminals and consoles.

Overview

print-arabic is a simple yet powerful utility that handles the complexity of displaying Arabic text correctly in Python applications. It combines Arabic text reshaping and bidirectional text rendering to ensure Arabic characters are displayed properly.

Features

  • Automatic Arabic text reshaping
  • Bidirectional text support
  • Simple, easy-to-use API
  • Works in terminals and consoles

Installation

Install using pip:

pip install print-arabic

Usage

import print_arabic

# Print Arabic text - direct usage
print_arabic("مرحبا بالعالم")

# Print mixed Arabic and English text
print_arabic("Hello مرحبا")

# Print Arabic with numbers
print_arabic("العدد ١٢٣٤٥")

# Alternative: use the function explicitly
print_arabic.print_arabic("النص العربي")

How It Works

The library uses two key components:

  1. arabic-reshaper: Reshapes Arabic text to connect letters properly
  2. python-bidi: Applies the bidirectional algorithm for correct text direction

Requirements

  • Python 3.6 or higher
  • python-bidi >= 0.4.2
  • arabic-reshaper >= 2.1.3

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Azwri (aazwri@gmail.com)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Repository

https://github.com/azwri/print_arabic

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

print_arabic-0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

print_arabic-0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page