A aesthetic replacement to print()
Project description
Fancy Print
An aesthetic replacement to print()
Development Status: Early Development/Usable
About
FancyPrint is a python package, making it easier for developers to get beautiful CLI with responsiveness in regards to terminal size.
Usage
Installing FancyPrint
To install fancyprint use the following command:
pip install fancyprint
This will install all dependencies needed as well.
Getting Started
To start using Fancy Print, first import it.
import fancyprint
This will import all the necessary functions required.
Basics
Printing
The pretty_print()
function is for printing text to the terminal. There are two ways one can use it, and they can be
used interchangeably:
- Using presets (recommended)
- Using keyword arguments
Using Presets
Presets allow you to customize the printer and the separator, and they can be local presets or global presets. Presets are local when they are created for one part only(i.e Printer) and are global when they can be used anywhere (both in the Separator and the Printer).
Using Local Presets
There are two types of local presets you can use:
- PrinterPreset
- SeparatorPreset
PrinterPreset
The PrinterPreset
is used to customize the pretty_print()
function. To use it, you need to import it first.
Here is an example of declaring a PrinterPreset
:
from src.fancyprint.ftypes import PrinterPreset
from src.fancyprint.ftypes import Color
my_custom_printer_preset = PrinterPreset(
delimiter_left="<",
delimiter_left_color=Color.RED,
delimiter_right=">",
delimiter_right_color=Color.RED,
delimiter_space_amount=10,
delimiter_space_symbol=" ",
hyphenation=False
)
Here's the preset in action:
[...]
pretty_print("Hi, this is some text", )
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fancyprint-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ae55695680686b03a2064fe53921349f08e9bafc7f670cfaa9ccd0145c9e711 |
|
MD5 | 0e31ac9af779b9870acc5e04d033bdc9 |
|
BLAKE2b-256 | c82add338a6d7a3dc9000cfbd4248481a09191750fd3fa086f4db8c450b8d6ff |