core.table module¶
Provides an object oriented way to print out tables.
-
class
core.table.
Alignment
[source]¶ Bases:
enum.Enum
Contains constants to specify the aligment of table items.
-
CENTER
()¶ S.center(width[, fillchar]) -> str
Return S centered in a string of length width. Padding is done using the specified fill character (default is a space)
-
LEFT
()¶ S.ljust(width[, fillchar]) -> str
Return S left-justified in a Unicode string of length width. Padding is done using the specified fill character (default is a space).
-
RIGHT
()¶ S.rjust(width[, fillchar]) -> str
Return S right-justified in a string of length width. Padding is done using the specified fill character (default is a space).
-
-
class
core.table.
AsciiTable
(*columns)[source]¶ Bases:
object
Represents 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.
-
-
class
core.table.
Column
(name, alignment=<method 'center' of 'str' objects>, left_padding=2, right_padding=2)[source]¶ Bases:
list
Represents a column of a table.