openpyxl.formatting.rule module¶
-
openpyxl.formatting.rule.
CellIsRule
(operator=None, formula=None, stopIfTrue=None, font=None, border=None, fill=None)[source]¶ Conditional formatting rule based on cell contents.
-
class
openpyxl.formatting.rule.
ColorScale
(cfvo=None, color=None)[source]¶ Bases:
openpyxl.formatting.rule.RuleType
-
color
¶ A sequence (list or tuple) that may only contain objects of the declared type
-
tagname
= 'colorScale'¶
-
-
openpyxl.formatting.rule.
ColorScaleRule
(start_type=None, start_value=None, start_color=None, mid_type=None, mid_value=None, mid_color=None, end_type=None, end_value=None, end_color=None)[source]¶ Backwards compatibility
-
class
openpyxl.formatting.rule.
DataBar
(minLength=None, maxLength=None, showValue=None, cfvo=None, color=None)[source]¶ Bases:
openpyxl.formatting.rule.RuleType
-
color
¶ Values must be of type <class ‘openpyxl.styles.colors.Color’>
-
maxLength
¶ Values must be of type <class ‘int’>
-
minLength
¶ Values must be of type <class ‘int’>
-
showValue
¶ Values must be of type <class ‘bool’>
-
tagname
= 'dataBar'¶
-
-
openpyxl.formatting.rule.
DataBarRule
(start_type=None, start_value=None, end_type=None, end_value=None, color=None, showValue=None, minLength=None, maxLength=None)[source]¶
-
class
openpyxl.formatting.rule.
FormatObject
(type, val=None, gte=None, extLst=None)[source]¶ Bases:
openpyxl.descriptors.serialisable.Serialisable
-
extLst
¶ Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
-
gte
¶ Values must be of type <class ‘bool’>
-
tagname
= 'cfvo'¶
-
type
¶ Value must be one of {‘percentile’, ‘formula’, ‘min’, ‘num’, ‘percent’, ‘max’}
-
val
¶ Values must be of type <class ‘float’>
-
-
openpyxl.formatting.rule.
FormulaRule
(formula=None, stopIfTrue=None, font=None, border=None, fill=None)[source]¶ Conditional formatting with custom differential style
-
class
openpyxl.formatting.rule.
IconSet
(iconSet=None, showValue=None, percent=None, reverse=None, cfvo=None)[source]¶ Bases:
openpyxl.formatting.rule.RuleType
-
iconSet
¶ Value must be one of {‘3TrafficLights1’, ‘4Arrows’, ‘4RedToBlack’, ‘3Flags’, ‘4Rating’, ‘5Quarters’, ‘5ArrowsGray’, ‘5Rating’, ‘3Arrows’, ‘3TrafficLights2’, ‘3ArrowsGray’, ‘3Signs’, ‘5Arrows’, ‘4TrafficLights’, ‘4ArrowsGray’, ‘3Symbols’, ‘3Symbols2’}
-
percent
¶ Values must be of type <class ‘bool’>
-
reverse
¶ Values must be of type <class ‘bool’>
-
showValue
¶ Values must be of type <class ‘bool’>
-
tagname
= 'iconSet'¶
-
-
openpyxl.formatting.rule.
IconSetRule
(icon_style=None, type=None, values=None, showValue=None, percent=None, reverse=None)[source]¶ Convenience function for creating icon set rules
-
class
openpyxl.formatting.rule.
Rule
(type, dxfId=None, priority=0, stopIfTrue=None, aboveAverage=None, percent=None, bottom=None, operator=None, text=None, timePeriod=None, rank=None, stdDev=None, equalAverage=None, formula=(), colorScale=None, dataBar=None, iconSet=None, extLst=None, dxf=None)[source]¶ Bases:
openpyxl.descriptors.serialisable.Serialisable
-
aboveAverage
¶ Values must be of type <class ‘bool’>
-
bottom
¶ Values must be of type <class ‘bool’>
-
colorScale
¶ Values must be of type <class ‘openpyxl.formatting.rule.ColorScale’>
-
dataBar
¶ Values must be of type <class ‘openpyxl.formatting.rule.DataBar’>
-
dxf
¶ Values must be of type <class ‘openpyxl.styles.differential.DifferentialStyle’>
-
dxfId
¶ Values must be of type <class ‘int’>
-
equalAverage
¶ Values must be of type <class ‘bool’>
-
extLst
¶ Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
-
formula
¶ A sequence (list or tuple) that may only contain objects of the declared type
-
iconSet
¶ Values must be of type <class ‘openpyxl.formatting.rule.IconSet’>
-
operator
¶ Value must be one of {‘between’, ‘notContains’, ‘greaterThanOrEqual’, ‘lessThan’, ‘greaterThan’, ‘endsWith’, ‘containsText’, ‘lessThanOrEqual’, ‘notBetween’, ‘equal’, ‘beginsWith’, ‘notEqual’}
-
percent
¶ Values must be of type <class ‘bool’>
-
priority
¶ Values must be of type <class ‘int’>
-
rank
¶ Values must be of type <class ‘int’>
-
stdDev
¶ Values must be of type <class ‘int’>
-
stopIfTrue
¶ Values must be of type <class ‘bool’>
-
tagname
= 'cfRule'¶
-
text
¶ Values must be of type <class ‘str’>
-
timePeriod
¶ Value must be one of {‘thisWeek’, ‘thisMonth’, ‘tomorrow’, ‘lastWeek’, ‘last7Days’, ‘nextWeek’, ‘today’, ‘lastMonth’, ‘yesterday’, ‘nextMonth’}
-
type
¶ Value must be one of {‘aboveAverage’, ‘top10’, ‘uniqueValues’, ‘colorScale’, ‘dataBar’, ‘containsText’, ‘duplicateValues’, ‘containsBlanks’, ‘expression’, ‘notContainsText’, ‘endsWith’, ‘timePeriod’, ‘notContainsBlanks’, ‘notContainsErrors’, ‘containsErrors’, ‘iconSet’, ‘cellIs’, ‘beginsWith’}
-
-
class
openpyxl.formatting.rule.
RuleType
[source]¶ Bases:
openpyxl.descriptors.serialisable.Serialisable
-
cfvo
¶ A sequence (list or tuple) that may only contain objects of the declared type
-
-
class
openpyxl.formatting.rule.
ValueDescriptor
(*args, **kw)[source]¶ Bases:
openpyxl.descriptors.base.Float
Expected type depends upon type attribue of parent :-(
Most values should be numeric BUT they can also be cell references