Skip to main content

pycols

A Python module for colorating console content

Installation

Using pip

You can install pycols via pip using

  • in a commandline:

  • py -m pip install pycols
    

  • in a python script:

  • import os
    os.system('py -m pip install pycols')
    

    Usage

    Colorating content

    1. Create a pycols.color object:
      import pycols
      c = pycols.color()
      

      This will initialize all three style elements pycols can alter: Style, Foreground and Background.

    2. Given that you want to make a text e.g. red for an error, you can change this:
      print("An error occured")
      

      easily to the following:

      code_red = c.col("RED")
      print(code_red + "An error occured")
      

      Here, the color.col search method is used.
      There is also a search methods for background colors (color.bcol).
      These two methods will automatically switch to searching for light colors with the color.lcol / color.lbcol methods, when they detect a "LIGHT_" part in your color description.

    3. Reset the coloring with one of the following:
      print(c.col("RESET"))
      

      for resetting only the color of the foreground,

      print(c.bcol("RESET"))
      

      for resetting only the color of the background

      print(c.RESET)
      

      for resetting only the current styling or finally

      print(c.RESET_ALL)
      

      for resetting all of them.

    Others

    Use the following to get information about your release and the author of the module:

    pycols.about()
    

    More coming soon

    Release files for pycols 1.0.3

    For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

    Source distribution (sdist)

    Source distribution for pycols 1.0.3
    File Size Uploaded
    pycols-1.0.3.tar.gz 3.5 kB Details

    Built distribution (wheel)

    Table of built distributions (wheels) for pycols 1.0.3
    File Interpreter ABI Platform
    pycols-1.0.3-py3-none-any.whl Python 3 none any Details

    Total release size:7.3 kB

    Release files / pycols-1.0.3.tar.gz

    Download URL pycols-1.0.3.tar.gz
    Size 3.5 kB
    Tags Source
    SHA-256 checksum
    How to use checksums
    22e4a1510dfbc3264231767269758b7764f351f2b1ec6a90b19c9f7de28e6044
    BLAKE2b-256 checksum
    How to use checksums
    aa42cb86d1dc290d7c10ec5fc88f2a3981946aa98c6e24b58e0f8e80047b8bea
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/4.0.2 CPython/3.11.0

    Release files / pycols-1.0.3-py3-none-any.whl

    Download URL pycols-1.0.3-py3-none-any.whl
    Size 3.8 kB
    Tags Python 3
    SHA-256 checksum
    How to use checksums
    d38407fad5b1e021b457ac62bb665ea0b13b6f2a2a4718155b628f11224171cd
    BLAKE2b-256 checksum
    How to use checksums
    4447f5b3a3f0d7898d0a73fb9bd5402f18f57b7b940de14efccba91524a14309
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/4.0.2 CPython/3.11.0

    Release history Release notifications | RSS feed

    This release

    1.0.3 This release

    2 release files

    1.0.2

    2 release files

    1.0.1

    2 release files

    1.0.0

    2 release files

    Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page