Skip to content

smartlegionlab/smarttextdecorator

Repository files navigation

Smart Text Decorator

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.


Author and developer: A.A. Suvorov


GitHub top language PyPI - Downloads GitHub release (latest by date) GitHub PyPI PyPI - Format GitHub Repo stars GitHub watchers GitHub forks


Help:

  • pip install smarttextdecorator
from smarttextdecorator.tools import SmartPrinter
smart_printer = SmartPrinter()
SmartPrinter.print_framed(char='-')
smart_printer.print_center(text='Smart Legion Lab')

Exemple:

from smarttextdecorator.tools import SmartPrinter


def main():
    smart_printer = SmartPrinter()
    smart_printer.show_head(text='Smart Legion Lab')
    print()
    smart_printer.print_framed(text='Hello World!!!')
    print()
    smart_printer.show_footer(text='https://github.com/smartlegionlab/')


if __name__ == '__main__':
    main()

image


Disclaimer of liability:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright:

--------------------------------------------------------
Licensed under the terms of the BSD 3-Clause License
(see LICENSE for details).
Copyright © 2024, A.A. Suvorov
All rights reserved.
--------------------------------------------------------