Skip to main content

Simple package to easy color & transform your console string and output

Project description

coloralf

Info :

This package is all you need for transform and colored your print in the console. It's easy and quick to use, and can be ameliarate the clearness of your output. (In the followed informations, sorry for my awful english .....)

Installation & importation :

Install with :

pip install coloralf

Importation (as c is not obligatory but this make coloralf easy to use) :

import coloralf as c

All transformation :

For see all transformation, you can execute :

c.test()

I write all in details at the end of this description.

Usage :

You can mainly use coloralf in two way : in a f-string or as print function.

In a f-string :

It's a easy way to make print with different colors. For exemple : For write "Ce chat mignon s'apelle Chouquette" with :

  • Ce in red
  • chat with a yellow background
  • mignon in italic
  • Chouquette in underline and light magenta You can :
print(f"{c.r}Ce{c.d} {c.by}chat{c.d} {c.ti}mignon{c.d} s'apelle {c.m}{c.tu}Chouqette{c.d}")

You can change color, back, etc., and combine transformation. (You can notice the c.d, is for delete/reset all transformation)

In print function :

It's a quick way to use coloralf. You can directly print a sentence (str) with the wanted transformation : just need to add 'f' before the transformation-code. Excemple : For write "Super librairie" in red :

c.fr("Super librairie")

If you want several transformations, you can use the f function : For write "Encore un exemple ..." in underlined (tu), red (r), blink (tb), with green back :

c.f("Encore un exemple ...", 'tu.r.tb.bg')

It's just a combinaison of all transformation-codes join by a .

List of all transformations :

  • FOR PRINT FUNCTION : add a f before the transformation-code
  • FOR COLOR : a lighter color, add a l before the color-code
  • FOR FORMAT : to reset, replace the t by r
  • FOR RESET ALL : c.d or c.ra or c.rall

Font Colors :

  • (c.k) Black (for exemple light black : (c.lk))
  • (c.r) Red
  • (c.g) Green
  • (c.y) Yellow
  • (c.b) Blue
  • (c.m) Magenta
  • (c.c) Cyan
  • (c.w) White
  • (c.rfc) Reset font color

Background Colors :

  • (c.bk) Black (for exemple light black : (c.blk))
  • (c.br) Red
  • (c.bg) Green
  • (c.by) Yellow
  • (c.bb) Blue
  • (c.bm) Magenta
  • (c.bc) Cyan
  • (c.bw) White
  • (c.rbc) Reset back color

Format transformations :

  • (c.ti0) Week intensity
  • (c.ti1) Normal intensity
  • (c.ti2) Strong intensity
  • (c.ti) Italic
  • (c.tu) Underline
  • (c.tu2) Double underline
  • (c.tb) Blink
  • (c.th) Hide
  • (c.tc) Cross

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

coloralf-0.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

coloralf-0.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file coloralf-0.3.tar.gz.

File metadata

  • Download URL: coloralf-0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for coloralf-0.3.tar.gz
Algorithm Hash digest
SHA256 20ca197bbc9618b6f90a42569d2209d3b093307fdbd7bfc13b82b34e71973d01
MD5 e6389b36c27e90dde5969e0ed94ed5b2
BLAKE2b-256 0683f88da5091cf4939aefbae131dafaca81e1bb6ac6c5faf6b55b8b4315ac06

See more details on using hashes here.

File details

Details for the file coloralf-0.3-py3-none-any.whl.

File metadata

  • Download URL: coloralf-0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for coloralf-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f3aef36f957939e150092e657ddbf1fadda1d5aaa579ec7b7f46c2f20070dbbd
MD5 9444389d2a3073477c2d01bec301883b
BLAKE2b-256 587990c4dfc526ed9d3fd58d141f95748b94f0f91a8b397191e41beede265d45

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