Skip to main content

Luminance is a library for working with user output and console input

Project description

luminance

LuminanceCLI is a versatile Python library designed to enhance console interactions across a wide range of Python language versions.

Installation

  • Stable version:
git clone https://github.com/reslaid/luminance.git
  • Unreleased version:
git clone -b dev https://github.com/reslaid/luminance.git

Usage

from luminance import AnsiConsole

# Create an instance of AnsiConsole
console = AnsiConsole()

# Styling text
console.printf(
    "Hello, AnsiConsole!",
    style=[
        console.Styles.BOLD,
        console.Styles.UNDERLINE,
        console.Colors.Fore.GREEN,
        console.Colors.Back.WHITE
    ]
)

# Gradient printing
console.grd_printf(
    "Gradient Text",
    color1="#FF0000",
    color2="#00FF00"
)

# Get user input with styled prompt
user_input = console.inputf(
    "Enter something:",
    style=[
        console.Styles.BOLD,
        console.Colors.Fore.CYAN
    ]
)

# Get password input with styled prompt
password = console.passf(
    "Enter password:",
    style=[
        console.Styles.BOLD,
        console.Colors.Fore.YELLOW
    ]
)

# Clear the console
console.clearf()

# Set console title
console.titlef("My Console App")

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

luminance-0.1.3.tar.gz (6.1 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