A Python library to print Arabic text with proper bidirectional support
Project description
Print Arabic
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:
- arabic-reshaper: Reshapes Arabic text to connect letters properly
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file print_arabic-0.1.tar.gz.
File metadata
- Download URL: print_arabic-0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0475be1db8f5d1dbc2eebdef65aeac4ce182e8e0d0182a77f3096c495687240d
|
|
| MD5 |
34b6825215244c0f35cf3dcbd0676a83
|
|
| BLAKE2b-256 |
7dd5a10cd669cce6a6f02a0fc50b879808ae141074369b7de8fc57c9b381e02c
|
File details
Details for the file print_arabic-0.1-py3-none-any.whl.
File metadata
- Download URL: print_arabic-0.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0be90f27447840784a6485656726db4ab6cac67af06d5d0015ba55d1d56f92b
|
|
| MD5 |
7f03961f83cd057af15bd41190aad88b
|
|
| BLAKE2b-256 |
db9d8951d105357c342c06ad794f22caf37018a34a3590d017cc984da156c0ef
|