Expand description
Unified formatting utilities for UI and logging
Functionsยง
- format_
size - Format file size in human-readable form (KB, MB, GB, etc.)
- indent_
block - Indent a block of text with the given prefix
- truncate_
byte_ budget - Truncate a string so that the retained prefix is at most
max_bytesbytes, rounded down to the nearest UTF-8 char boundary. Returns the truncated prefix withsuffixappended, or the original string when it already fits. - truncate_
text - Truncate text to a maximum length (in chars) with an optional ellipsis.