Skip to main content

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

Metadata

Release files for print-arabic 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for print-arabic 0.1
File Size Uploaded
print_arabic-0.1.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for print-arabic 0.1
File Interpreter ABI Platform
print_arabic-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page