Skip to main content

Spiff up your CLI with color, formatting, and utilities

Project description

Project Description

spiffyline is a terminal utility package that provides formatting, coloring to terminal output via abstraction of ANSI SGR codes.

Features:

  • Abstraction of ANSI SGR codes for ease of use
  • Predefined colors for quick formatting
  • Theme class to combine SGR codes to reuse
  • Utility methods to make adding formatting and color simple and concise

Ussage:

from spiffyline.theme import Theme
from spiffyline.logger import Logger

# Theme with bold and red text
my_theme = Theme.BOLD + Theme.fg_color( 230, 0, 0 )

print(  my_theme + "Hello World!" + Theme.RESET )

# One can also use the Logger class for more concise code

l = Logger()
l.log( "Hello World!", my_theme )

# Or to record certain logging events

l.log( "Error", my_theme, flags=[ "error", ] )
print( l.events[ "error" ] ) # => 1

Please download the API Documentation from GitHub

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spiffyline-1.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

spiffyline-1.0-py3-none-any.whl (5.4 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