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

Uploaded Source

Built Distribution

pyucc-1.5-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyucc-1.5.tar.gz
Algorithm Hash digest
SHA256 107c01e422df1f391ca77f5c0603b6d016395418def20ad4180789305cdaac4a
MD5 fc0dd2afd2c839fe4bf4fefd019e70f6
BLAKE2b-256 b6fe613d8058c751d35baa1c6dc97e9836e392bb6cc5798fa3681db1ed933a02

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyucc-1.5-py3-none-any.whl
  • Upload date:
  • Size: 2.9 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cbf25903fbd0195379fe66bb82995a489ad548a63c1e32fc67650eb0112fda68
MD5 ffcad85d0c498b4ed44bc51e075a9ecc
BLAKE2b-256 b16f3238b278bcfeb958c4062138753e4bc1f7f48ab4c1cb900c759b3d1e47cb

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