Skip to main content

A small package for printing colored strings

Project description

colorP

This package is a small and simple utility for printing colored strings on consoles. colorP supports 9 different formatting styles and several foreground and background colors!

You can install it by issuing the following command on a UNIX terminal:

sudo pip install -i colorp

Usage:

Methods :-

pPrint(args,text,br=?):

  • args: is a dictionary object, which needs atleast one of s,fg or bg defined with the corresponding values as strings.
args = {'s':'bold','fg':'red','bg':'white'}
  • text: is the string to be printed with the given styling
  • br: [OPTIONAL ARGUMENT: default value= True], can set it to False if you need no linebreak after ouput.

Eg():

  • prints out examples of a few colors and styles for user visualization.

Styling and Formatting:

  • The args object decides how the text will be formatted. Each key in args can be one of certain pre-defined values. They are listed below:
  • 's': Text style
Value Description
'plain' Formats the text as plain text
'bold' Bolds the text
'dim' Dims the text
'italic' Italicizes the text
'underline' Underlines the text
'blink' Blinks the text repeatedly
'reverse' Swaps foreground and background values
'hidden' Hides the text on display
'striked' Strikes off the desired text
  • 'fg': Font color
Value
'black'
'red'
'green'
'yellow'
'blue'
'magenta'
'cyan'
'lightgray'
'darkgray'
lightred'
'lightgreen'
'lightyellow'
'lightblue'
'lightmagenta'
'lightcyan'
'white'
'default'
  • 'bg': Background color
Value
'black'
'red'
'green'
'yellow'
'blue'
'magenta'
'cyan'
'lightgray'
'darkgray'
lightred'
'lightgreen'
'lightyellow'
'lightblue'
'lightmagenta'
'lightcyan'
'white'
'default'
NOTE:
  • 'bg' has the same possible values as 'fg'.

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

colorp-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

colorp-0.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file colorp-0.0.1.tar.gz.

File metadata

  • Download URL: colorp-0.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for colorp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 59f604107265c71886529f820f95eb4338c39adc8653651ede0de1e79f27ae3e
MD5 5f14b7f2a523edd9d69d469190d9a483
BLAKE2b-256 8d818fc8c35af10aa044288a5d0adbf2624faf9668397ea1ec9a0cbb8e2d0a82

See more details on using hashes here.

File details

Details for the file colorp-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: colorp-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for colorp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b30d73a829f47740ff85abf5bf111bc5031c47406258f98d42586a7257ca5303
MD5 b1f752b0411f467d5938d4b658f26841
BLAKE2b-256 dd3d1fa7131700a8279f619b955ca78cf47ba14ae96dee0cf118b42f9e29933e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page