(self, data, title='report', header=None, widths=None)
return wb
Create just a openpxl workbook from a list of data
Create just a openpxl workbook from a list of data
Create just a openpxl workbook from a list of data
def list_to_workbook(self, data, title='report', header=None, widths=None):
        """ Create just a openpxl workbook from a list of data """
        wb = Workbook()
        title = re.sub(r'\W+', '', title)[:30]

        if isinstance(data, dict):
            i = 0
            for sheet_name, sheet_data in data.items():
                if i > 0:
                    wb.create_sheet()
                ws = wb.worksheets[i]
                self.build_sheet(
                    sheet_data, ws, sheet_name=sheet_name, header=header)
                i += 1
        else:
            ws = wb.worksheets[0]
            self.build_sheet(data, ws, header=header, widths=widths)
        return wb
def list_to_workbook ( self , data , title = 'report' , header = None , widths = None ) : wb = Workbook ( ) title = re . sub ( r'\W+' , '' , title ) [ : 30 ] if isinstance ( data , dict ) : i = 0 for sheet_name , sheet_data in data . items ( ) : if i > 0 : wb . create_sheet ( ) ws = wb . worksheets [ i ] self . build_sheet ( sheet_data , ws , sheet_name = sheet_name , header = header ) i += 1 else : ws = wb . worksheets [ 0 ] self . build_sheet ( data , ws , header = header , widths = widths ) return wb