A Python library for correct printing of Persian (Farsi) text with RTL support and styling options.
Project description
print_fa
print_fa is a Python library designed to address common issues with printing Persian (Farsi) text in various environments, especially in terminals like VS Code where right-to-left (RTL) text display, character shaping, and proper alignment can be problematic.
Features
- Correct Persian Text Display: Ensures proper rendering of Persian characters, handling ligatures and character joining.
- Right-to-Left (RTL) Support: Automatically adjusts text direction for correct RTL display.
- Colored Output: Easily print Persian text in various colors.
- Styling Options: Apply bold and underline styles to your Persian text.
- User-Friendly: Simple and intuitive API for easy integration into your Python projects.
- Optimized for Performance: Designed to be efficient for both small scripts and large-scale applications.
Installation
YouYou can install print_fa using pip:
pip install print-fa
Usage
Here's how to use print_fa in your Python code:
from print_fa import print_fa
# Basic usage
print_fa("سلام دنیا")
# With color
print_fa("متن قرمز", color="red")
# With bold style
print_fa("متن پررنگ", bold=True)
# With underline style
print_fa("متن زیرخط", underline=True)
# With multiple styles
print_fa("متن آبی و پررنگ", color="blue", bold=True)
# Persian text mixed with English
print_fa("این یک متن فارسی است با کلمات English در آن.")
Available Colors
You can use the following color names (case-insensitive):
blackredgreenyellowbluemagentacyanwhite
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests on the GitHub repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
httex
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_fa-0.1.0.tar.gz.
File metadata
- Download URL: print_fa-0.1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d7062db48d5121339a30c460cdb725cf6967c24f09b9bfb029ab6a8aa96754f
|
|
| MD5 |
6290534a25a8a6ac5ec69f91b63f539c
|
|
| BLAKE2b-256 |
ad7fd3944830e7ae6e8142734dd1e740da0893656d6fdcd253d0ac2bf558d5d9
|
File details
Details for the file print_fa-0.1.0-py3-none-any.whl.
File metadata
- Download URL: print_fa-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8d8c052da18836edb82be1bd27aa9515b5ffadb8c6e4b398a214177630ef1a9
|
|
| MD5 |
2a93e81cbffafc2eb71ff9d4461bab28
|
|
| BLAKE2b-256 |
6b14af39197514127dd602ef70370c983317a84acd54d2d5aaabc8d8b09cf86e
|