Skip to main content

A high level, unoptimized, colored console written in python.

Project description

PyUCC

An Unoptimezed Console Colorization tool written in python.

How to Install

This python project was converted to a pypi package, to install this package you can just use pip.

pip install pyucc

Usage

After installing the package with pip, all you need to do is import it like you would any other package and work on colorizing your precious console. This package relies on ANSI Unicode Escape Sequences to allow for coloring in the rgb space inside your console.

from pyucc import console, colors

# Use cprint or colored print just like you would pythons print method.
console.cprint(colors.vibrant_red, "This text is in red")

# You can also use formatting
console.cprint(f"{colors.vibrant_red}This text is also in red")

# Use .switch for background switch
console.cprint(f"{colors.vibrant_red.switch}This text has a red background")

Basic Red Text

There are some more advanced use cases like registering your own console class:

from pyucc import console, colors, symbols

@console.register(identifier="test")
def test(*values, **optional):
  # Optional can be used to access "optional" values like time.
  time = optional.get("time")
  console.cprint(f"{colors.vibrant_purple.switch} Debug {symbols.reset} {colors.chex('#aaaaaa')}{time}{symbols.reset}", *values)

console.test("This is the test method")

Advanced customized console

Also, cprint can be used as print if you need to.

from pyucc import console
console.cprint("This is just a print")

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

pyucc-1.7.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

pyucc-1.7-py3-none-any.whl (8.2 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