Skip to main content

A aesthetic replacement to print()

Project description

Fancy Print

An aesthetic replacement to print()


Development Status: Early Development/Usable

PyPI

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

fancyprint-0.1.1.1.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

fancyprint-0.1.1.1-py3-none-any.whl (13.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page