pygauss.docs module

Created on Tue Jun 16 15:52:53 2015

@author: chris sewell

class pygauss.docs.MSDocument(docx=None)[source]

Bases: object

a class to output a Microsoft Word Document

inherited api details for docx.document.Document can be found at; https://python-docx.readthedocs.org/en/latest/api/document.html

Parameters:docx (str or file-like object) – can be either a path to a .docx file (a string) or a file-like object. If docx is missing or None, the built-in default document “template” is loaded.
__dir__()[source]

required to have docx.Document methods in ipython tab completion

__getattr__(name)[source]

required to get docx.Document methods

add_dataframe(df, incl_indx=True, autofit=True, sig_figures=5, style='Medium List 1 Accent 1')[source]

add dataframe as a table

add_list(text_list=[], numbered=False)[source]

adds a list

add_markdown(text='', style='Body Text')[source]

adds a paragraph to the document, allowing for markdown style bold and italic text

add_mpl(fig, dpi=None, width=None, height=None, pad_inches=0.2)[source]

add matplotlib figure to the document, width/height in cm Amount of padding around the figure