Skip to main content

A Python library for pretty printing and enhanced console output.

Project description

PrettyPi

PyPI - Python Version PyPI version PyPI - License PyPI - Downloads Doc - link

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.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

prettypi-0.3.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file prettypi-0.3.1.tar.gz.

File metadata

  • Download URL: prettypi-0.3.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for prettypi-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d72298a4d6affd98fd6bc0ad3179bb169a88f9af41aa095c31ee4a2e32949958
MD5 88e27c5e33c1dd2ce143ff514a7e2244
BLAKE2b-256 39387e63ecfb5e61125c02f8969e67f665597c99cbd83c3854ccce247cf563bf

See more details on using hashes here.

File details

Details for the file prettypi-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: prettypi-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for prettypi-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 100d6e105a4a5da96c9099a869d1dde6ce2b5ff44646fb96545806aad38ef30a
MD5 492644c1ea137b94827be155c9ddb373
BLAKE2b-256 52967e5aeb7a0187be3fff15ed533f3aaf15c29cee37f03a56eb1de9a48f5bfc

See more details on using hashes here.

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