Skip to main content

A simple colouring package for making console programmes great again.

Project description

Colorain

Ever wondered how people make those console programmes print in pretty colours? Well, the answer is simple: there are colour codes with which you have to tag up the text. The problem is, the codes are pretty complicated, and so typically people write bland, all-whites console programmes. Colorain is a package that makes printing coloured text to the console a piece of cake. Using a simple markup designed just for colouring text on the terminal, Colorain allows you to quickly add colours to any Python project you might have. There's a few other packages that help you to print colourful text with Python, but none with the ease of use as Colorain.

Installation

pip install colorain

Usage

from colorain import *
# parses the colour tags and colour-codes the text as needed
txt = ColoredText('`f|y`Okay`f|n`, workin `f|c`fine`f|n`') 

# prints the coloured text
print(txt) 

# strips off the colour tags and gives the raw text
print(txt.raw_text()) 

# we've overloaded the plus operator for you
# so that you can manipulate your strings just
# as usual
print(txt + FGRed("\nOr is it?") + "\n*VSauce background intensifies*")

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

colorain-0.0.15b2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

colorain-0.0.15b2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file colorain-0.0.15b2.tar.gz.

File metadata

  • Download URL: colorain-0.0.15b2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.8

File hashes

Hashes for colorain-0.0.15b2.tar.gz
Algorithm Hash digest
SHA256 4476655dade1524a891c57194f5d05096499e3a491845887a0dedb33cef3ebf5
MD5 e57d4bfcbc2da6dff5b4ddad2ffafb57
BLAKE2b-256 6729117e96439f9203b6d7b02d4620f21cd6ff69571a774e5a4b1d22476fae1b

See more details on using hashes here.

File details

Details for the file colorain-0.0.15b2-py3-none-any.whl.

File metadata

  • Download URL: colorain-0.0.15b2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.8

File hashes

Hashes for colorain-0.0.15b2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fc0a330811d487eb9ea10fd1eaf1333c7da18e0701b0b86e81c6df75faaaac3
MD5 33d130803ccdf132dd3a325ebd476651
BLAKE2b-256 3da0554eb6c06197e1a1e8f4d0ae0899397e1ae66c8da8548553e9044fbe4e34

See more details on using hashes here.

Supported by

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