goatools.wr_tbl_class module

Helper Class and functions for writing tables.

class goatools.wr_tbl_class.WrXlsxParams(**kws)[source]

Bases: object

Class containing user-specified or default parameters.

class goatools.wr_tbl_class.WrXlsx(fout_xlsx, nt_flds, **kws)[source]

Bases: object

Class to store/manage Excel spreadsheet parameters.

dflt_fmt_hdr = {'bold': True, 'bottom': 0, 'left': 0, 'right': 0, 'top': 0}
wr_title(worksheet, row_idx=0)[source]

Write title (optional).

wr_row_mergeall(worksheet, txtstr, fmt, row_idx)[source]

Merge all columns and place text string in widened cell.

wr_hdrs(worksheet, row_idx)[source]

Print row of column headers

wr_data(xlsx_data, row_i, worksheet)[source]

Write data into xlsx worksheet.

add_worksheet()[source]

Add a worksheet to the workbook.

static set_xlsx_colwidths(worksheet, fld2col_widths, fldnames)[source]

Set xlsx column widths using fld2col_widths.

class goatools.wr_tbl_class.WbFmt(nt_flds, workbook, **kws)[source]

Bases: object

Manages Workbook format objects.

dflt_wbfmtdict = [{'border': 0}, {'bg_color': '#eeeded', 'bold': True, 'bottom': 0, 'left': 0, 'right': 0, 'top': 0}, {'bg_color': '#d3d3d3', 'bold': True, 'bottom': 0, 'left': 0, 'right': 0, 'top': 0}, {'bold': True, 'border': 1}]
get_prt_flds()[source]

Remove namedtuple fields used for formatting rows, but not printed.

get_hdrs(**kws)[source]

Initialize column headers.

get_wbfmt(data_nt=None)[source]

Return format for text cell.

get_fmt_section()[source]

Grey if printing header GOs and plain if not printing header GOs.

goatools.wr_tbl_class.get_hdrs(flds_all, **kws)[source]

Return headers, given user-specified key-word args.