Cross-platform Python library, smart printer for console applications
Normal output, colored output, pager support, centered text with indentation.
smartprinter — cross-platform Python library for smart printing in console applications.
Has several different objects for displaying to the console or generating a string:
PrintersFactory for easy creationVia PyPI:
pip3 install smartprinter
With requirements:
pip install -r requirements.txt
For development:
pip install requirements/requirements-dev.txt
Using Printer class:
from smartprinter.printers import Printer
printer = Printer()
printer.base.echo('Text')
printer.click.echo('Text', show=True, color='green')
printer.smart.echo('Text', show=True, char='*')
printer.pager.echo('Text', show=True)
Using PrintersFactory:
from smartprinter.printers import PrintersFactory def_printer = PrintersFactory.get_base() click_printer = PrintersFactory.get_click() smart_printer = PrintersFactory.get_smart() pager = PrintersFactory.get_pager()
| Printer | Description | Parameters |
|---|---|---|
base | Normal output | text |
click | Colored output | text, show=True, color='green' |
smart | Centered output with indentation | text, show=True, char='*' |
pager | Pager support (scrollable) | text, show=True |
Comprehensive test coverage with pytest:
pytest --cov --cov-report=html
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