Skip to main content

A python module to color your terminal output life

Project description

PyPI - Python Version PyPI Code style: black

Setup

pip3 install colorifix

Requirements

  • Python 3.6+

Usage

It's very simple to use, just remember three symbols:

  • # to set a color
  • @ to set a style
  • ! to set a background
from colorifix.colorifix import paint

paint("[#red]String to color in red [#blue]and in blue")
paint("[#yellow !green]One color and background at a time,[#red #cyan] last set win")
paint("[@bold @underline]Many styles in one [@dim]string")
paint("[#44 !123]You can use int bash colors")

Examples

Remove styles

You can remove every part of a style with the symbol / followed by the symbol of the style you want to remove. You can use it alone to remove every styles, it will remove every styles anyway at the end of the string.

paint("[#yellow @underline]This is a yellow underline string[/@], now only yellow[/].")

Remove example

Print or not print

You can choose to print the string or just save it in a variable.

colored_str = paint("[!black @dim]Hello Color![/]") # save it
ppaint("[!42]Again![/]") # print it directly
paint("[!42]Again![/]", False) # print it from main function, same as above

Colors

To disaply all different colors, you can use the function sample

from colorifix.colorifix import sample

sample()  # base colors
sample(complete=True)  # to display all bash int colors

Base colors

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

colorifix-2.0.4.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file colorifix-2.0.4.tar.gz.

File metadata

  • Download URL: colorifix-2.0.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/60.5.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.10

File hashes

Hashes for colorifix-2.0.4.tar.gz
Algorithm Hash digest
SHA256 38fe5ed76dbdfa06efeffb392e0532e76abddd70c54d90646ea40b982f748f0b
MD5 cc1b0de717ec11bfa99fa607740e2747
BLAKE2b-256 75f50ffd76c05f8aa537045c02a58b1ef097ad5e6a029851d5e8a9357d243039

See more details on using hashes here.

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