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.2.tar.gz (9.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.2-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prettypi-0.3.2.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

Hashes for prettypi-0.3.2.tar.gz
Algorithm Hash digest
SHA256 5be75fad56390601115fb63abf325bd463274874b78e53fa18668a1793fce3d0
MD5 4efda7e9cc5371fe75d9a34b8136ffac
BLAKE2b-256 c98229ee1dccdff63fb092fb45d119469d7fe6ca4c745f6042bb225283f7268d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prettypi-0.3.2-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

Hashes for prettypi-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba172f26af4ed45beb9713e20c821851c10d475b0d826da1d18ddfb34964c86e
MD5 62734dab086ae533fda4f36b4ebeb49c
BLAKE2b-256 497becc7f4b5ff87604c131a94cd10611bcc89c51b78349244dc997892d40973

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