Smart Text Decorator v1.0.0

Smart text decorator

A library for decorating strings and displaying them beautifully in the console.

Python Text Decorator CLI Console PyPI

Smart Text Decorator — a library for decorating strings and displaying them beautifully in the console.

  • Generates and displays lines to the full width of the console with the specified text and a placeholder character
  • Generates and displays a line with the specified text, decorated at the top and bottom with filler characters along the length of the line

> Use for beautiful design of console applications.

  • print_framed — display line with placeholder character at full console width
  • print_center — display text centered in the console
  • show_head — display formatted header with title
  • show_footer — display formatted footer with URL and copyright
  • Filler Character — customize placeholder character for decoration
  • Full Console Width — automatically adapts to terminal width
  • Cross-Platform — Windows, Linux, macOS, Termux

pip install smarttextdecorator

Basic usage:

from smarttextdecorator import SmartPrinter

SmartPrinter.print_framed(symbol='-')
SmartPrinter.print_center(text='Smart Legion Lab')

Complete example:

from smarttextdecorator import SmartPrinter

def main():
    SmartPrinter.show_head(text='Smart Legion Lab')
    print()
    SmartPrinter.print_framed(text='Hello World!!!')
    print()
    SmartPrinter.show_footer(
        url='https://github.com/smartlegionlab/',
        copyright_='Copyright © 2024, Alexander Suvorov. All rights reserved.'
    )

if __name__ == '__main__':
    main()

MethodDescriptionParameters
print_framedDisplay line with placeholder character at full console widthtext='', symbol='-', width=None
print_centerDisplay text centered in the consoletext='', width=None
show_headDisplay formatted header with titletext='', symbol='-', width=None
show_footerDisplay formatted footer with URL and copyrighturl='', copyright_='', symbol='-', width=None

By using this software, you agree to the full disclaimer terms.

Software provided "AS IS" without warranty. You assume all risks.

Full legal disclaimer: See DISCLAIMER.md

License: BSD 3-Clause License