Skip to main content

Module that decorates your console

Project description

clrfterm

Module that decorates your console



Description

clrfterm makes it easy to work with ANSI escape sequences that decorate your console. ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video text terminals and terminal emulators. Certain sequences of bytes, most starting with an ASCII escape character and a bracket character, are embedded into text. The terminal interprets these sequences as commands, rather than text to display verbatim.

Installation

  • Tested on CPython 3.7, 3.8 and 3.9
  • No requirements other than the standard library.
pip install clrfterm

Usage

Colored Output
from clrflterm import (
    Styles,
    Foreground,
    Backgrounds,
    rprint,
    reset,
)


print(Foreground.RED + "Red foreground text")
print(Backgrounds.WHITE + "White backgrounds text")
print(Styles.UNDERLINE + "Underlined text")
reset()
print("Back to normal text")

rprint("Auto reset", foreground=Foreground.GREEN)
print("Normal text")
Available formatting constants are:
Foregrounds: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE.
Backgrounds: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE.
Styles: BOLD, UNDERLINE, RESET

reset the function resets the foreground, background. It must be called upon exiting the program.

License

This module is licensed under the terms of the MIT license.

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

clrfterm-0.1.tar.gz (3.6 kB view hashes)

Uploaded Source

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