BPrinter is a feature-rich library for terminal text styling that works seamlessly across Windows, macOS, and Linux.
pip install bprinterfrom bprinter import Color, Background, Style
# Simple color usage
print(Color.RED + "Red text" + Style.RESET)
# Combining styles
print(Color.BLUE + Background.WHITE + Style.BOLD + "Bold blue text on white background" + Style.RESET)
# Using context manager
with Style.color('red'):
print("This text is red")
print("And this one too")- π¨ 16 basic colors and 256 extended colors
- π RGB color support
- βοΈ Text styling (bold, italic, underline, etc.)
- π€ ASCII art generation
- π Markdown-like text formatting
- π₯ Cross-platform compatibility
- π― Simple and intuitive API
- π Extensible architecture
from bprinter import BPrinter
bp = BPrinter(show_time=True)
bp.success("Operation completed successfully!")
bp.error("An error occurred")
bp.warning("Warning: Low memory")
bp.info("Processing data...")
bp.debug("Debug information")from bprinter import ASCIIArtGenerator
# Create ASCII art
print(ASCIIArtGenerator.render("Hello!", color="red"))
# Preview different fonts
print(ASCIIArtGenerator.preview_fonts("ABC"))from bprinter import Printer
printer = Printer(enable_formatting=True)
printer("This is **bold** and _italic_ text")
printer("Use `code` and {red|colored text}")For detailed documentation and examples, visit our GitHub repository.
MIT License