Pretty-print tabular data in Python with extensive formatting options and output format support.
Overall
score
69%
A utility that calculates the display width of text strings, accounting for wide characters and whitespace handling preferences.
@generates
def calculate_width(text: str) -> int:
"""
Calculate the display width of text based on current module configuration.
Args:
text: The text string to measure
Returns:
The calculated display width as an integer
"""
pass
def set_wide_chars_mode(enabled: bool) -> None:
"""
Configure whether wide characters (CJK) should be counted with double width.
Args:
enabled: True to enable wide character support, False to disable
"""
pass
def set_preserve_whitespace(enabled: bool) -> None:
"""
Configure whether leading and trailing whitespace should be preserved in calculations.
Args:
enabled: True to preserve whitespace, False to strip it
"""
pass
def get_wide_chars_mode() -> bool:
"""
Get the current wide character mode setting.
Returns:
True if wide character support is enabled, False otherwise
"""
pass
def get_preserve_whitespace() -> bool:
"""
Get the current whitespace preservation setting.
Returns:
True if whitespace preservation is enabled, False otherwise
"""
passProvides table formatting with configurable module-level settings for wide character support and whitespace handling.
Install with Tessl CLI
npx tessl i tessl/pypi-tabulatedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10