openpyxl.formatting.formatting module

class openpyxl.formatting.formatting.ConditionalFormatting(sqref=(), pivot=None, cfRule=(), extLst=None)[source]

Bases: Serialisable

cells

Values must be of type <class ‘openpyxl.worksheet.cell_range.MultiCellRange’>

cfRule

A sequence (list or tuple) that may only contain objects of the declared type

pivot

Values must be of type <class ‘bool’>

rules

A sequence (list or tuple) that may only contain objects of the declared type

sqref

Values must be of type <class ‘openpyxl.worksheet.cell_range.MultiCellRange’>

tagname = 'conditionalFormatting'
class openpyxl.formatting.formatting.ConditionalFormattingList[source]

Bases: object

Conditional formatting rules.

add(range_string, cfRule)[source]

Add a rule such as ColorScaleRule, FormulaRule or CellIsRule

The priority will be added automatically.