openpyxl.formatting.formatting module

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

Bases: openpyxl.descriptors.serialisable.Serialisable


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


Values must be of type <class ‘bool’>


Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)


Values must be of type <class ‘str’>

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.