A Python library for pretty printing and enhanced console output.
Project description
PrettyPi
PrettyPi is a Python library for enhancing console output with colorful and style text, emojis, tables, and more.
Features
- PrettyPrint
- Emoji: Add emojis to your console messages.
- Color: Easily print text in various colors.
- Style: Easily print text with style.
- Background Color: Print text with colored background.
- Alignment: Support text alignment (left, center, right).
- Alert: print alert messages
- PrettyTable
- Display: Create and display tables in the console.
- Custom: Customize table formatting and styles.
- Template: Define and use templates for displaying tables.
- Sorting: Implement sorting functionality for table columns.
- Filtering: Add filtering capabilities to tables based on user-defined criteria.
- Pagination: Enable pagination for large datasets displayed in tables.
- PrettyTree
- Display: Create and display tree.
- Color: Color node in tree.
- Style: Custom style node in tree.
Installation
You can install PretiPy using pip:
pip install prettypi
Usage
Here's a quick example of how to use PrettyPi:
pretty_print
from prettypi.pretty_print import StyledStr
from prettypi.utils import Color, Style, Emoji, BackgroundColor
styled_str = StyledStr("My name", background_color=BackgroundColor.MAGENTA, style=Style.UNDERLINE)
styled_str2 = StyledStr("Toto", color=Color.RED, style=Style.BOLD)
print(f"{styled_str} is {styled_str2} {Emoji.SMILE}")
pretty_print Alert
from prettypi.pretty_print import Alert
alert = Alert.info("This is an information alert")
print(alert)
pretty_tree
from prettypi.pretty_tree import TreeNode
from prettypi.utils import Color, Style
root = TreeNode("Root", color=Color.RED, style=Style.BOLD)
child1 = TreeNode("Child1")
child2 = TreeNode("Child2")
child1.add_child(TreeNode("Child1.1"))
child1.add_child(TreeNode("Child1.2"))
root.add_child(child1)
root.add_child(child2)
root.display()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prettypi-0.3.3.tar.gz
(9.6 kB
view details)
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
prettypi-0.3.3-py3-none-any.whl
(11.5 kB
view details)
File details
Details for the file prettypi-0.3.3.tar.gz.
File metadata
- Download URL: prettypi-0.3.3.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
620031bbcbda04058d34740adb99e2df9bb3b08bbfd5767b404c1a5eeb4f77f8
|
|
| MD5 |
b4f46ce831f58c88dc90f8e533a19eac
|
|
| BLAKE2b-256 |
5cb7bd1de53407281de11cd38aa4cec4f650fe3a35ed6b94ffc2ea901ec4c324
|
File details
Details for the file prettypi-0.3.3-py3-none-any.whl.
File metadata
- Download URL: prettypi-0.3.3-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad43ef7d6de06d5d208eab31cbc165257576402cf01d432793c2fc1c75eb90c9
|
|
| MD5 |
6d3c6362d689a109a951d4034d9f112a
|
|
| BLAKE2b-256 |
60ad7c56cfaa1a1d597d71103575441673c4e02e4a9159555f6a61ae7b7e96e8
|