A terminal markup language, inspired by tml
Project description
Terminal Markup Language (tml)
- A python library to make the output of colored text in the terminal easier and more readable.
Example
from tml import markup
print(markup("<red>this text is <bold>red</bold></red> and the following is <green>green</green>"))
Alternatively, you can use the mprint()
function, which is a convenient shortcut.
from tml import mprint
mprint("<red>this text is <bold>red</bold></red> and the following is <green>green</green>")
You don't need to close the tag explicitly if it is not needed.
print(markup("<on-green><blue>this text has blue foreground on green background colors"))
If you would like to print brackets, use them in doubles:
print(markup("<bold>This is <<example>></bold>"))
Available Tags
Foreground
<black>
<red>
<green>
<yellow>
<blue>
<magenta>
<cyan>
<white>
<bright-black>
<light-black>
<bright-red>
<light-red>
<bright-green>
<light-green>
<bright-yellow>
<light-yellow>
<bright-blue>
<light-blue>
<bright-magenta>
<light-magenta>
<bright-cyan>
<light-cyan>
<bright-white>
<light-white>
Background
<on-black>
<on-red>
<on-green>
<on-yellow>
<on-blue>
<on-magenta>
<on-cyan>
<on-white>
<on-bright-black>
<on-light-black>
<on-bright-red>
<on-light-red>
<on-bright-green>
<on-light-green>
<on-bright-yellow>
<on-light-yellow>
<on-bright-blue>
<on-light-blue>
<on-bright-magenta>
<on-light-magenta>
<on-bright-cyan>
<on-light-cyan>
Attributes
<bold>
<b>
<dark>
<italic>
<i>
<underline>
<u>
<blink>
<reverse>
<concealed>
<strike>
Acknowledgement
- This library is inspired by tml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_tml-1.0.2.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file python_tml-1.0.2.tar.gz
.
File metadata
- Download URL: python_tml-1.0.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3f9b1bc324ad6a8cd2128b215691ada768906192a1f19ebb3e4ebb03874fa67 |
|
MD5 | 99dcdb73419f502e1175da06b30b495c |
|
BLAKE2b-256 | e40ef039d151142bceae1409c11ace0b1683752a380a222ee0bc85e38f8cfffc |
File details
Details for the file python_tml-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: python_tml-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f53fa57f154a36a5b0e2740eb081043fe8792e3bbe2434a3c0c478152907121c |
|
MD5 | ba861ace0372126d03647174bac149b0 |
|
BLAKE2b-256 | b04879565b58661a1a25c89f4b66ce17044d675c0cc787d46e9b464f50190af9 |