Easy-to-use color coordination terminal library with simple customization & function binding.
Use now with pip install ezmk
Use the mark() function as you'd use the print() function but with the additional features of easy-to-add format modification.
Modify text color by prefixing your statement with ^, followed by an appropriate color specification.
Example
mark("^red This text is red!")
Use the # key to specify the background color, and use the ~ key to specify styling such as bold, underline, or italic. Colors and styles autocomplete if identifying initial words are used like mark("#r This text's background is red!").
You can add multiple modifiers if you indicate their end with a space like mark("#m^b~u working text!"). Using mark("#m ^b ~u failed text!") will only interpret the first modifier.
To print a simple and noticeable message to the console, fire the mark() function without arguments.
black, red, green, yellow, blue, magenta, cyan, white, gray, light-red/lr, light-green/lg, light-yellow/ly, light-blue/lb, light-magenta/lm, light-cyan/lc, light-white/lw
bold/b, dim/d, italic/i, underline/u, blink/bl, reverse/r, hidden/r, strikethrough/r
To pass a function and bind it to a custom key you can use bind(). When the key is used following the bind character: @ like mark("@bnd_fnc Binded function fired!") the function will be called.
To set a function to bind to the mark() function itself pass the function without a key.
You can specify presets in configuration, allowing you to use a key(activation string) to add a collection of modifiers to a statement. No space is needed to indicate a preset's ending unless the preset contents a space itself. This enables very handy color-coordinated printing to the console:
Example
mark("!Alert preset.")ormark("$Success preset.")(using default presets.)
To configure, create ezmk.cfg file in the project directory.
ping:stringWhat's printed to the console whenmark()when fired without any arguments.debug:boolIf set to true, print the raw interpretation of each mark statement to terminal.presets:dictCustom keys that load configured format modifiers. Defaults include(to change default either override or list in blacklist):!as~b^r#y$as^lg#gwarnas^y~btestas^m~imainas^blu#bla~u
blacklistPresets or modifiers that don't get interpreted.
