openpyxl.styles.stylesheet module

class openpyxl.styles.stylesheet.Stylesheet(numFmts=None, fonts=(), fills=(), borders=(), cellStyleXfs=None, cellXfs=None, cellStyles=None, dxfs=(), tableStyles=None, colors=None, extLst=None)[source]

Bases: Serialisable

borders

Wrap a sequence in an containing object

cellStyleXfs

Values must be of type <class ‘openpyxl.styles.cell_style.CellStyleList’>

cellStyles

Values must be of type <class ‘openpyxl.styles.named_styles._NamedCellStyleList’>

cellXfs

Values must be of type <class ‘openpyxl.styles.cell_style.CellStyleList’>

colors

Values must be of type <class ‘openpyxl.styles.colors.ColorList’>

property custom_formats
dxfs

Wrap a sequence in an containing object

extLst

Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>

fills

Wrap a sequence in an containing object

fonts

Wrap a sequence in an containing object

classmethod from_tree(node)[source]

Create object from XML

numFmts

Values must be of type <class ‘openpyxl.styles.numbers.NumberFormatList’>

tableStyles

Values must be of type <class ‘openpyxl.styles.table.TableStyleList’>

tagname = 'styleSheet'
to_tree(tagname=None, idx=None, namespace=None)[source]
openpyxl.styles.stylesheet.apply_stylesheet(archive, wb)[source]

Add styles to workbook if present

openpyxl.styles.stylesheet.write_stylesheet(wb)[source]