WordWriter
- class czsc.utils.WordWriter(file_docx=None)[source]
Bases:
object
用 Word 文档记录信息
Methods Summary
add_df_table
(df[, style])添加数据表
add_heading
(text[, level])添加分页符
add_paragraph
(text[, style, bold, ...])新增段落
add_picture
(file[, width, height, alignment])写入图片到文档中
add_title
(text)save
([file_docx])保存结果到文件
Methods Documentation
- add_df_table(df: DataFrame, style='Table Grid', **kwargs)[source]
添加数据表
https://www.jianshu.com/p/93e0df92cf16
- Parameters:
df – 数据表
style – 表格样式
- Returns:
- add_paragraph(text, style=None, bold=False, first_line_indent=0.74)[source]
新增段落
- Parameters:
text – 文本
style – 段落样式
bold – 是否加粗
first_line_indent – 首行缩进,0.74 表示两个空格
- Returns: