A Python library to create pretty terminal output
Project description
PrettyPy
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.