Skip to main content

Easy-to-use color coordination terminal library with simple custmization & function binding.

Project description

EZMK - Easy Mark

Easy-to-use color coordination terminal library with simple custmization & function binding.

Use now with pip install ezmk

mark(string, **kwargs)

Use the mark() as you would 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 is also 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 simply fire the mark() function without arguments.

Text Foreground and Background Colors

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

Text Style Effects

bold/b • dim/d • italic/i • underline/u • blink/bl • reverse/r • hidden/r • strikethrough/r

bind(func, activation_string, args=(args), kwargs=(kwargs))

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.

Presets

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.") or mark("$Success preset.") (using default presets.)

Configuration

To configure, create ezmk.cfg file in the project directory.

  • ping:string What's printed to the console when mark() when fired without any arguments.
  • deubg:bool If set to true, print's to terminal the raw interpretation of each mark statement.
  • presets:dict Custom keys that load configured format modifiers. Defaults include(to change default either override or list in blacklist):
    • ! as ~b^r#y
    • $ as ^lg#g
    • warn as ^y~b
    • test as ^m~i
    • main as ^blu#bla~u
  • blacklist Presets or modifiers that don't get interpreted.

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

ezmk-1.0.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

ezmk-1.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file ezmk-1.0.0.tar.gz.

File metadata

  • Download URL: ezmk-1.0.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for ezmk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c6e74d6d613e5a19b2a99e380ad48b2901bb657b5ef8be80d5a77d0072dfcdbb
MD5 137f11c379185b9b09147ed7eb73f30a
BLAKE2b-256 4ff91272a4e641051bb76cb881792cf6ad41972a5ec82b28934f43edc12f82b7

See more details on using hashes here.

File details

Details for the file ezmk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ezmk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for ezmk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07a25ccdbf1c34668ed0e38d5612b6e7ec487b55dfd97b44f395dd58e7156d9e
MD5 56415af0ebf94f633ece4885254913c2
BLAKE2b-256 43f7227b02873a8cdeda1f1346846e199b5ca56a44a95310db3cad8522cc886f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page