5.3. Table Format

class pytablewriter.FormatAttr[source]

Bitmaps to represent table attributes.

API = 64

Can call API for external service.

BIN = 16

Table format that can represent as a binary file.

FILE = 4

Can create a file with the format.

SOURCECODE = 32

Can create a source code (variables definition) one of the programming language.

TEXT = 8

Table format that can represent as a text.

class pytablewriter.TableFormat(value)[source]

Enum to represent table format attributes.

classmethod find_all_attr(format_attribute: int)List[source]

Searching table formats which have specific attributes.

Parameters

format_attribute (FormatAttr) – Table format attributes to look for.

Returns

Table formats that matched the attribute.

Return type

List[TableFormat]

classmethod from_name(format_name: str)[source]

Get a table format from a format name.

Parameters

format_name (str) – Table format specifier.

Returns

A table format enum value corresponding to the format_name.

Return type

Optional[TableFormat]

property file_extensions

File extensions associated with the table format.

Returns

Return type

List[str]

classmethod find_all_attr(format_attribute: int)List[source]

Searching table formats which have specific attributes.

Parameters

format_attribute (FormatAttr) – Table format attributes to look for.

Returns

Table formats that matched the attribute.

Return type

List[TableFormat]

property format_attribute

Table attributes bitmap.

Returns

Return type

pytablewriter.FormatAttr

classmethod from_file_extension(file_extension: str)[source]

Get a table format from a file extension.

Parameters

file_extension (str) – File extension.

Returns

A table format enum value corresponding to the file_extension.

Return type

Optional[TableFormat]

classmethod from_name(format_name: str)[source]

Get a table format from a format name.

Parameters

format_name (str) – Table format specifier.

Returns

A table format enum value corresponding to the format_name.

Return type

Optional[TableFormat]

property names

Names associated with the table format.

Returns

format names

Return type

List[str]

property writer_class

Table writer class object associated with the table format.

Returns

Return type

Type[AbstractTableWriter]