https://github.com/noah-yoshida/prettycli
🎨 command line output utils for Python to draw boxes, colors, etc
https://github.com/noah-yoshida/prettycli
ascii cli colorization colors command-line python3
Last synced: 8 months ago
JSON representation
🎨 command line output utils for Python to draw boxes, colors, etc
- Host: GitHub
- URL: https://github.com/noah-yoshida/prettycli
- Owner: noyoshi
- License: bsd-3-clause
- Created: 2019-12-05T17:59:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-06T04:18:30.000Z (over 6 years ago)
- Last Synced: 2025-01-12T21:33:26.019Z (over 1 year ago)
- Topics: ascii, cli, colorization, colors, command-line, python3
- Language: Python
- Homepage:
- Size: 57.6 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🎨 prettycli 🌟
Dependency free pretty CLI printing in Python (colors, unicode boxes, etc). More to come!
### Installation
`$ python3 -m pip install prettycli`
```py
from prettycli import red, blue, yellow, color
# You can print a basic color by passing a string into the color object
print(red("this is red"))
# You can add other attributed to what you print by calling methods on the
# color objects
print(red("this is red and bold").bold())
# You can set the background by passing in a color object to the bg method
print(red("this is red, with a blue background").bg(blue))
# We even support true colors! You can use the base object 'color' and modify
# the foreground with the rgb method
print(color("This was made with true color rgb").rgb(60, 100, 120))
```
### Color module demo

_Made with asciinema_
_Ignore the bold thing it is a bug with asciinema_
_Also ignore the old import name_
### Box module demo
_Made with asciinema_
If you want something that can be used in shell scripting, I have another repo: [noyoshi/bashcolors](https://github.com/noyoshi/bashcolors)
#### TODO
- [ ] Performance checks - this should be as lightweight as possible
- [ ] Unit tests
- [x] No more dynamic variable definitions, as that messes with linters
- [ ] `box.py` demo + better abstractions