AQIT 0.1.0
Loading...
Searching...
No Matches
aquin.table_plain Namespace Reference

Functions

dict[str, str] _glyphs ()
str _cell (str text, int width, *, str align="left")
str format_table (Sequence[str] headers, Sequence[Sequence[str]] rows, *, Sequence[str]|None aligns=None, int max_col=48)
None print_table (Sequence[str] headers, Sequence[Sequence[str]] rows, *, Sequence[str]|None aligns=None, int max_col=48, str|None title=None)

Variables

dict _UNICODE
dict _ASCII

Function Documentation

◆ _cell()

str _cell ( str text,
int width,
* ,
str align = "left" )
protected

Definition at line 36 of file table_plain.py.

◆ _glyphs()

dict[str, str] _glyphs ( )
protected

Definition at line 27 of file table_plain.py.

Referenced by format_table().

◆ format_table()

str format_table ( Sequence[str] headers,
Sequence[Sequence[str]] rows,
* ,
Sequence[str] | None aligns = None,
int max_col = 48 )
Return a bordered table as a multi-line string.

Definition at line 48 of file table_plain.py.

References _glyphs().

Referenced by print_table().

◆ print_table()

None print_table ( Sequence[str] headers,
Sequence[Sequence[str]] rows,
* ,
Sequence[str] | None aligns = None,
int max_col = 48,
str | None title = None )

Definition at line 89 of file table_plain.py.

References format_table().

Variable Documentation

◆ _ASCII

dict aquin.table_plain._ASCII
protected
Initial value:
= {
"tl": "+", "tr": "+", "bl": "+", "br": "+",
"h": "-", "v": "|",
"l": "+", "r": "+", "t": "+", "b": "+", "x": "+",
}

Definition at line 20 of file table_plain.py.

◆ _UNICODE

dict aquin.table_plain._UNICODE
protected
Initial value:
= {
"tl": "┌", "tr": "┐", "bl": "└", "br": "┘",
"h": "─", "v": "│",
"l": "├", "r": "┤", "t": "┬", "b": "┴", "x": "┼",
}

Definition at line 15 of file table_plain.py.