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.6.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

pyucc-1.6-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file pyucc-1.6.tar.gz.

File metadata

  • Download URL: pyucc-1.6.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pyucc-1.6.tar.gz
Algorithm Hash digest
SHA256 781fdeee7fa7724d7277ae6f05ee78154217a68b96e5ef616eedae3b9ead61a8
MD5 28f5eedd8c135f397bedf4d35f3681f5
BLAKE2b-256 d478c490358331a64dbe1d5dfcc0d878bf04d354ddba3319d9475893e0bbdaad

See more details on using hashes here.

Provenance

File details

Details for the file pyucc-1.6-py3-none-any.whl.

File metadata

  • Download URL: pyucc-1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pyucc-1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bba9f367031cf9e0c99f34c022ba1ad12baf2f762bd0c846fa246dea9ae453d6
MD5 46ee4dcccabd4fb419594af33c622b9d
BLAKE2b-256 de8eca65731b92c0dcf12f2a7c27b2a81d5f79ecc3f88d0e50cb1987f9400fe8

See more details on using hashes here.

Provenance

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