Skip to main content

A Python library to create pretty terminal output

Project description

PrettyPy

PyPI - Python Version PyPI version PyPI - Downloads

PrettyPy is a Python library. It provides a simple API for printing messages with colours and styles. Colour output is a great way to make your CLI applications more user-friendly and readable. Status messages, error messages and other types of messages can be printed with coloured indicators to make them stand out from the rest.

To create custom layouts and print messages with them, PrettyPy provides a simple API. To quickly improve the readability of your CLI applications, it also provides a set of default layouts.

ANSI escape codes are used for colouring. These are supported by most devices.

Features

  • Print messages with colors and styles
  • Create custom layouts
  • No color mode
  • Table output
  • Updating messages
  • Progress bars
  • Spinners
  • Desktop notifications

Installation

pip install prettypy

Usage

from prettypy import Pretty

# Create a new Pretty object
p = Pretty()

# Print an error message
p.error('Something went wrong')

# Print a success message
p.success('Everything is fine')

# Customize the output with composer
c = p.get_composer()

# Add a simple layout
c.add('simple', '[S]', 'blue')

# Print a message with the simple layout
c.compose('simple', 'This is a simple message')

[✗] Something went wrong
[✓] Everything is fine
[S] This is a simple messages


GitHub repo size GitHub commit activity

GitHub issues GitHub closed issues GitHub pull requests

GitHub contributors

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

prettypy-0.1.2.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

prettypy-0.1.2-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page