π¨ Customize bullet list prompts in your Python CLI tool. Extensive support for formatting, colors, background colors, and etc.
from bullet import Bullet
cli = Bullet(...)
result = cli.launch(prompt)
$ pip install bullet
π· To fully customize your list prompt, you'll have to take total control of formatting and colors. Here's what you need to know.
from bullet import Bullet
cli = Bullet() # Create a Bullet object
result = cli.launch() # Launch a list prompt
cli = Bullet(choices = ["first item", "second item", "thrid item"])
cli = Bullet(bullet = "β
")
from bullet import styles
client = Bullet(**styles.Greece)
from bullet import colors
π¨ The following colors are supported in
bullets
.
black, red, green, yellow, blue, magenta, cyan, white
π¨ Remember to specify
foreground
andbackground
.
black_foreground = colors.foreground["black"]
white_background = colors.background["white"]
π¨ Define the following colors when initializing the
Bullet
object.
- Use foreground colors:
bullet_color
word_color
word_on_switch
- Use background colors:
background_color
background_on_switch
π Define the following when initializaing the
Bullet
object.
indent
: distance from left-boundary to start of prompt.pad_right
: extended background length.align
: distance between bullet and start of prompt.margin
: distance between list item and bullets.shift
: number of new lines between prompt and first item.