Skip to content

XulbuX Python Library

A modern, high-performance Python library to simplify common tasks.

XulbuX Logo


Quick Installation ​

bash
pip install xulbux

Expressive Code at a Glance ​

python
import xulbux as xx
from xulbux import S, hexa

# Prompt the user with styled input:
input_hexa_str = xx.console.input(
    (S.BOLD("Enter a hex color"), S.DIM(" > ")),
    placeholder="#FF3D5D",
)

# Initialize the input string as a `hexa()` object:
hexa_color = hexa(input_hexa_str)

# Nicely display the color in different formats:
xx.console.box(
    (S.BOLD | S.BG.hex(hexa_color).with_text_fg())("          Preview          "),
    "{hr}",
    (S.BOLD("HEXA: "), S.ITALIC(str(hexa_color))),
    (S.BOLD("RGBA: "), S.ITALIC(str(hexa_color.as_rgba()))),
    (S.BOLD("HSLA: "), S.ITALIC(str(hexa_color.as_hsla()))),
    border_style=S.DIM,
    end="\n\n",
)
terminal
Enter a hex color > a8f

╭─────────────────────────────╮
│ Preview │
├─────────────────────────────┤
│ HEXA: #AA88FF │
│ RGBA: rgba(170, 136, 255) │
│ HSLA: hsla(257°, 100%, 77%) │
╰─────────────────────────────╯

Released under the MIT License.