Colour all the output!
Project description
housepaint
What is it?
housepaint
is a demonstration library for a talk on publishing Python packages. A silly little thing with limited
utility, it allows you to recolor an entire function's worth of text with beautiful, simple decorators.
Requirements
housepaint
requires Python >= 3.6.
As of version 0.0.1 it has no dependencies outside the Python standard library, except for pytest in dev
.
Installation
Via poetry
:
poetry add housepaint
Via pip
:
pip install housepaint
Usage
from housepaint import BG, FG, paint, Style
@paint(foreground=FG.GREEN, background=BG.BLACK, styles=Style.BOLD)
def success_example() -> None:
print("This")
print("Should")
print("All")
print("Be")
print("Green")
success_example()
Will result in all of the print output of the function success_example
being in bold, green font on a black background.
Limitations
This library relies on ANSI escape codes to recolour text. If your printed text has ANSI codes there's a good chance it won't work out well for you.
Can I use this in my project?
Yes, please do! The code is all open source and BSD-3-Clause licensed.
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
Built Distribution
Hashes for housepaint-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd69aebd1eac939e12d3d35e392e483efef813893b6b74802d77dba41f0e4961 |
|
MD5 | 0817f637fb12f9ea7b5eac521c271022 |
|
BLAKE2b-256 | a4181cd95a5ba78111bd27ff53a031ec379f72c9e335fa6119aadefe7fd22d0f |