ezcolor
Python colorizing strings library
A lightweight library for applying color and HTML text styles to the strings that uses the builder pattern for configuration. The ezcolor lets you have nice colorized output with extra HTML text styles like bold/italic/underline. compatible with bash/sh/zsh.
Features
A simple to use API
lightweight and written in pure python
Tested on python 3.6+ (not compatible with python2.x)
Not compatible with windows OS (command prompt, powershell)
Usage
$ pip install ezcolor
from ezcolor import Style
style = Style()
cp = style.add.foreground('green').apply()
cp('hello world')
Adding more attributes
cp = style.add.foreground('green').background('dark_gray').bold.italic.underline.apply()
cp('hello world')
Adding prefix for beautiful logging
cp = style.add.foreground('green').prefix('done').bold.italic.apply()
cp('Job is done!')
cp_error = style.add.foreground('red').prefix('error').bold.italic.apply()
cp_error('Error occurred!')
Use as decorator
@cp.decorate
def my_name(name, lastname):
return f"my name is {name} {lastname}"
print(my_name('Fardin', 'Allahverdinazhand'))
Color |
prefix |
|---|---|
black |
done |
red |
info |
green |
warning |
yellow |
error |
blue |
|
magenta |
|
cyan |
|
light_gray |
|
dark_gray |
|
light_red |
|
light_green |
|
light_yellow |
|
light_blue |
|
light_magenta |
|
light_cyan |
|
white |
Meta
Fardin Allahverdinazhand - @0x0ptim0us - 0x0ptim0us@gmail.com Distributed under the MIT license. see LICENSE.txt for more information.
Metadata
Release files for ezcolor 0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezcolor-0.7.tar.gz | 3.4 kB | Without provenance | Details for ezcolor-0.7.tar.gz |
Release files / ezcolor-0.7.tar.gz
| Download URL | ezcolor-0.7.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7a5d26ff8d75b765bf4622385f0d287541edf1c490eefbd1631f0b9e801253f
|
|
BLAKE2b-256 checksum How to use checksums |
46112f1cae292c09df309c5cb18bbb9751758507f20b384121bd562863b0f614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for ezcolor 0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.