Lets say we don’t use _colorize
I would be happy to make a full-fleged module complete with tests designed as a public API
It could include colors, word art, tables etc. all in the console
We could start with colors and if it gets enough community support, we can add everything else
As @timhoffm said, having a simple light stdlib that provides features like this doesn’t do any harm to us; having a minimum python version is much better than a 3rd party package which can make things ever-so complicated for programs optimized for simplicity and performance.
As for using _colorize: We don’t want to break working code. Lets make this a new library similar to _colorize but optimized to be a public API.
Same problem with colorama
and termcolor
: Third party libraries add an extra level of complexity for programs that don’t need complexity.
Define the color constants as class attributes on
ANSIColors
, and then make aColorCodes
set? Would an Enum be better? Is it ok thatNoColors = ColorCodes()
? Theming is a complex topic. Are you confident that the implemented approach is reasonable?
Yes. I am certain. It is quite reasonable; so many programs would benefit from this and this such as small yet important feature it deserves to have its own module. (IMO)
Sorry, but waste of what?
For simple programs that benefit from this no one wants to download a whole formatting library
Why not? Computers are fast. Why learn two libraries?
Working in a venv? Publishing a PyPi package? Oftentimes using the stdlib is way more convenient and not everyone wants to bundle and deal with reliability from 3rd party modules. If people want basic yet working support, they use stdlib. For more complex needs they can use rich.
I couldn’t have said it better myself:
Most people don’t actually need the bells and whistles provided by heavyweights such as Rich. The basic features offered by
_colorize
is enough for most people who just want to be able to format important words in bold or red.
And finally in response to:
Promoting a private module to public brings with it far greater maintenance obligations that you’re asking the core developers to take on. Beyond this, and the obvious other considerations of locking in the API, it means that there is less incentive to innovate, as the stdlib option will become the default, even if other packages have better solutions.
I would deal with the issues/PRs and everything else. And we want the stdlib to give a simple easy and functional example for simple programs that could take them to the next level
TL;DR
We should give an option as a new textfmt
module in the stdlib for simplicity and basic support, while if people need more they can use heavyweights. By doing this we would take many python applications to the next level!