core.table module -- Source.Python v743 documentation
core.table module
Provides an object oriented way to print out tables.
- class core.table. Alignment ( new_class_name , / , names , * , module = None , qualname = None , type = None , start = 1 , boundary = None ) [source]
Bases:
EnumContains constants to specify the aligment of table items.
- CENTER ( width , fillchar = ' ' , / )
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- LEFT ( width , fillchar = ' ' , / )
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- RIGHT ( width , fillchar = ' ' , / )
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- class core.table. AsciiTable ( * columns ) [source]
Bases:
objectRepresents a table.
- __init__ ( * columns ) [source]
Add the given objects as columns to the table.
If a given column is not a Column object, it will be created.
- add_row ( * items ) [source]
Append the given items to the table's columns.
- format ( header_separator = '=' , column_separator = '|' ) [source]
Format the table and returns an ASCII table string.
- class core.table. Column ( name , alignment=<method 'center' of 'str' objects> , left_padding=2 , right_padding=2 ) [source]
Bases:
listRepresents a column of a table.
- __init__ ( name , alignment=<method 'center' of 'str' objects> , left_padding=2 , right_padding=2 ) [source]
Intialize the column.