https://github.com/mystpi/tinted
Boring print output no more!
https://github.com/mystpi/tinted
Last synced: about 2 months ago
JSON representation
Boring print output no more!
- Host: GitHub
- URL: https://github.com/mystpi/tinted
- Owner: MystPi
- License: mit
- Created: 2021-11-10T00:42:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-12T17:46:35.000Z (over 4 years ago)
- Last Synced: 2025-02-12T20:03:34.124Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tinted
   
Give your print output the tint it deserves! Give colors, styles, and more to the console, all with a simple markup language.
## Installation
```bash
pip install tinted
```
## Usage
From a Python script:
```python
from tinted import tint
print(tint('Hello, [bold]world![/]'))
```
From a shell:
```bash
echo "Hello, [bold]world![/]" | tinted
# OR
tinted file.txt
```
## Basic syntax
Strings can be styled easily with an HTML-like syntax.
```
[bold][blue]Tinted[/] is [underline]cool[/]![/]
```
`[...]` denotes a starting tag, where `...` is a tag name.
`[/...]` indicates a closing tag. Tag names are not necessary, and are ignored if they are included.
## Tags
All of the available tags are listed below.
### Colors
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- lightgray
- darkgray
- lightred
- lightgreen
- lightyellow
- lightblue
- lightmagenta
- lightcyan
- white
### Background colors
Prefix any of the colors above with `bg`. Eg. `bglightred`.
### Styles
- bold
- dim
- italic
- underline
- blink
- reverse
- hidden
## Escaping tags
To escape a tag, simply include `[]` somewhere inside.
`[[]blue]These tags will be shown[[]/]`