This is a tool to output "poor" (because it is limited by standardized control codes) rich text into console.
You create a tree structure where each piece of string has its own stylesheet. After you have finished forming the output message you convert it into a string. The library does the rest.
The algorithm is damn simple: it just traverses the tree in depth-first way, determines exact style of each string, computes differences between them and emits control codes to apply them.
Python 3.Python 2is dead, stop raping its corpse. Use2to3with manual postprocessing to migrate incompatible code to3. It shouldn't take so much time. For unit-testing you need Python 3.6+ or PyPy3 because theirdictis ordered.
This library automatically imports colors and other control codes from the following libraries: