xlsx_writer.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:table-compositor 作者: InvestmentSystems 项目源码 文件源码
def to_xlsx(layout, output_fp, orientation='vertical', **kwargs):
        '''
        Take a layout which contains a list of presentation models builts using the build_presentation_model function.

        Args:
            layout: An nested list of presentation_models, examples: [presentation_model] or [presentation_model1, presentation_mode2] etc
            output_fp: the xlsx file name
            orientation: if vertical, the top level presentation model elements are rendered vertically, and for every nested level the orientation is flipped.
                         if horizontal, then the behavior is inverse
            kwargs:
                    column-width: default=20, the default column width of all columns in the worksheet. Individual column width cannot be set currently
        '''
        row_col_dict = GridLayoutManager.get_row_col_dict(
            layout, orientation=orientation)
        wb = Workbook()
        ws = wb.active
        XLSXWriter._to_xlsx_worksheet(row_col_dict, ws, **kwargs)
        wb.save(output_fp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号