Description
Escape is a very simple terminal styling library largely inspired by the excellent javascript chalk library. There are other terminal styling libraries such as colorama available but they do not offer a simple composable API like escape does. Escape is pure python, does not have any external dependencies and should work right out of the box. Escape has been tested to work with python 2.7 and python 3.6. Escape has not been tested on Windows
escape alternatives and similar packages
Based on the "Command-line Application Development" category.
Alternatively, view escape alternatives based on common mentions on social networks and blogs.
-
Python Fire
Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object. -
asciimatics
A cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations
Scout Monitoring - Free Django app performance insights with Scout Monitoring
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of escape or a related project?
README
escape
Escape is a very simple terminal styling library largely inspired by the excellent javascript chalk library. There are other terminal styling libraries such as colorama available but they do not offer a simple composable API like escape does. Escape is pure python, does not have any external dependencies and should work right out of the box. Escape has been tested to work with python 2.7 and python 3.6. Escape has not been tested on Windows
Install
pip install escape
Usage
from escape import Escape
print(Escape('Hello World').red())
# combine styled strings
print(Escape('Hello').bright_green() + Escape(' World!').bright_red())
# combibe styled and normal string
print(Escape('Hello').bright_magenta() + ' World!')
# compose multiple styles together
print(Escape('Hello World').bright_red().underline().bright_yellow_background())
# Nest styles
Escape('Hello ', Escape('World').bright_green_background()).bright_red()
Escape('Hello ' + Escape('World').bright_green_background()).bright_red()
Preview how styling looks on your terminal
from escape import palette
palette()
[alt tag](media/palette.png)
Styles
Modifiers
- bold
- dim
- hidden
- inverse
- italic
- strikethrough
- underline
Colors
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- gray
- bright_red
- bright_green
- bright_yellow
- bright_blue
- bright_magenta
- bright_cyan
- bright_white
Background Colors
- black_background
- red_background
- green_background
- yellow_background
- blue_background
- magenta_background
- cyan_background
- white_background
- bright_black_background
- bright_red_background
- bright_green_background
- bright_yellow_background
- bright_blue_background
- bright_magenta_background
- bright_cyan_background
- bright_white_background