Utils
This module contains all the utility constants that can be used in the pretty_print module.
Use the Emoji class to print emojis.
Use the Color class to color the text.
Use the Style class to set the style of the text.
Use the BackgroundColor class to set the background color of the text.
Use the Align class to align the text.
- class prettypi.utils.Align(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
EnumThis class contains the alignment options that can be used in the pretty print module.
- CENTER = 'center'
- LEFT = 'left'
- RIGHT = 'right'
- class prettypi.utils.BackgroundColor(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
EnumThis class contains ANSI color codes that can be used in the pretty print module.
Example:
from prettypi.utils import BackgroundColor print(f"{BackgroundColor.RED}This is a red background{BackgroundColor.RESET}")
- BLACK = '\x1b[40m'
- BLUE = '\x1b[44m'
- CYAN = '\x1b[46m'
- GREEN = '\x1b[42m'
- MAGENTA = '\x1b[45m'
- RED = '\x1b[41m'
- RESET = '\x1b[0m'
- WHITE = '\x1b[47m'
- YELLOW = '\x1b[43m'
- class prettypi.utils.Color(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
EnumThis class contains ANSI color codes that can be used in the pretty print module.
Example:
from prettypi.utils import Color print(f"{Color.RED}This is a red text{Color.RESET}")
- BLACK = '\x1b[30m'
- BLUE = '\x1b[34m'
- CYAN = '\x1b[36m'
- GREEN = '\x1b[32m'
- MAGENTA = '\x1b[35m'
- RED = '\x1b[31m'
- RESET = '\x1b[0m'
- WHITE = '\x1b[37m'
- YELLOW = '\x1b[33m'
- class prettypi.utils.Emoji(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
EnumThis class contains emojis that can be used in the pretty print module.
Example:
from prettypi.utils import Emoji print(f"{Emoji.SMILE} This is a smile emoji")
- ANTENNA_BARS = '📶'
- BEER = '🍺'
- BELL = '🔔'
- BELL_WITH_SLASH = '🔕'
- BOOK = '📖'
- BULB = '💡'
- CALENDAR = '📅'
- CAMERA = '📷'
- CAMERA_WITH_FLASH = '📸'
- CD = '💿'
- CHECK = '✅'
- CLAP = '👏'
- CLOCK = '⏰'
- COFFEE = '☕'
- COMPUTER = '💻'
- COMPUTER_DISK = '💽'
- CROSS = '❌'
- DIVIDE = '➗'
- DVD = '📀'
- ENVELOPE = '✉️'
- EXCLAMATION = '❗'
- FILM_FRAMES = '🎞️'
- FIRE = '🔥'
- FLOPPY_DISK = '💾'
- HEART = '❤️'
- HOURGLASS = '⌛'
- INFINITY = '♾️'
- INFORMATION = '🛈'
- KEY = '🔑'
- LOCK = '🔒'
- LOUDSPEAKER = '📢'
- MAGNIFYING_GLASS = '🔍'
- MAILBOX = '📬'
- MEGAPHONE = '📣'
- MINUS = '➖'
- MOBILE_PHONE = '📱'
- MOBILE_PHONE_OFF = '📴'
- MOBILE_PHONE_RECEIVER = '📲'
- MONEY = '💰'
- MOVIE_CAMERA = '🎥'
- MULTIPLY = '✖️'
- MUTE = '🔇'
- PACKAGE = '📦'
- PAPER = '📝'
- PAPERCLIP = '📎'
- PARTY = '🎉'
- PENCIL = '✏️'
- PLUS = '➕'
- PROJECTOR = '📽️'
- PYTHON = '🐍'
- QUESTION = '❓'
- RADIO = '📻'
- RADIO_BUTTON = '🔘'
- ROCKET = '🚀'
- SAD = '😢'
- SCISSORS = '✂️'
- SMILE = '😊'
- SPEAKER = '🔈'
- STAR = '⭐'
- TELEPHONE = '☎️'
- TELEPHONE_RECEIVER = '📞'
- TELEVISION = '📺'
- THUMBS_DOWN = '👎'
- THUMBS_UP = '👍'
- VIBRATION_MODE = '📳'
- VIDEO_CAMERA = '📹'
- WARNING = '⚠️'
- class prettypi.utils.Style(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
EnumThis class contains ANSI style codes that can be used in the pretty print module.
Example:
from prettypi.utils import Style print(f"{Style.BOLD}This is a bold text{Style.RESET}")
- BLINK = '\x1b[5m'
- BOLD = '\x1b[1m'
- DIM = '\x1b[2m'
- HIDDEN = '\x1b[8m'
- INVERT = '\x1b[7m'
- ITALIC = '\x1b[3m'
- RESET = '\x1b[0m'
- STRIKETHROUGH = '\x1b[9m'
- UNDERLINE = '\x1b[4m'