openpyxl.formatting.rule模块

openpyxl.formatting.rule.CellIsRule(operator=None, formula=None, stopIfTrue=None, font=None, border=None, fill=None)[源代码]

基于单元格内容的条件格式规则。

class openpyxl.formatting.rule.ColorScale(cfvo=None, color=None)[源代码]

基类:openpyxl.formatting.rule.RuleType

color

只能包含声明类型的对象的序列(列表或元组)

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)[源代码]

向后兼容

class openpyxl.formatting.rule.DataBar(minLength=None, maxLength=None, showValue=None, cfvo=None, color=None)[源代码]

基类:openpyxl.formatting.rule.RuleType

color

值的类型必须小于class“openpyxl.styles.colors.color”>

maxLength

值的类型必须小于class“int”>

minLength

值的类型必须小于class“int”>

showValue

值的类型必须小于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)[源代码]
class openpyxl.formatting.rule.FormatObject(type, val=None, gte=None, extLst=None)[源代码]

基类:openpyxl.descriptors.serialisable.Serialisable

extLst

值的类型必须为<class'openpyxl.descriptors.excel.extensionList'>

gte

值的类型必须小于class'bool'>

tagname = 'cfvo'
type

Value must be one of {'formula', 'percent', 'percentile', 'min', 'num', 'max'}

val

值的类型必须小于class“float”>

openpyxl.formatting.rule.FormulaRule(formula=None, stopIfTrue=None, font=None, border=None, fill=None)[源代码]

使用自定义差异样式的条件格式

class openpyxl.formatting.rule.IconSet(iconSet=None, showValue=None, percent=None, reverse=None, cfvo=None)[源代码]

基类:openpyxl.formatting.rule.RuleType

iconSet

Value must be one of {'5ArrowsGray', '3ArrowsGray', '3TrafficLights1', '5Rating', '4TrafficLights', '3Flags', '5Quarters', '3Signs', '3TrafficLights2', '3Symbols2', '5Arrows', '3Arrows', '4ArrowsGray', '3Symbols', '4Rating', '4Arrows', '4RedToBlack'}

percent

值的类型必须小于class'bool'>

reverse

值的类型必须小于class'bool'>

showValue

值的类型必须小于class'bool'>

tagname = 'iconSet'
openpyxl.formatting.rule.IconSetRule(icon_style=None, type=None, values=None, showValue=None, percent=None, reverse=None)[源代码]

创建图标集规则的便利功能

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)[源代码]

基类:openpyxl.descriptors.serialisable.Serialisable

aboveAverage

值的类型必须小于class'bool'>

bottom

值的类型必须小于class'bool'>

colorScale

值的类型必须小于class“openpyxl.formatting.rule.colorscale”>

dataBar

值的类型必须小于class“openpyxl.formatting.rule.databar”>

dxf

值的类型必须小于class“openpyxl.styles.differential.differentialStyle”>

dxfId

值的类型必须小于class“int”>

equalAverage

值的类型必须小于class'bool'>

extLst

值的类型必须为<class'openpyxl.descriptors.excel.extensionList'>

formula

只能包含声明类型的对象的序列(列表或元组)

iconSet

值的类型必须小于class“openpyxl.formatting.rule.iconset”>

operator

Value must be one of {'containsText', 'beginsWith', 'lessThanOrEqual', 'notBetween', 'greaterThan', 'greaterThanOrEqual', 'notContains', 'notEqual', 'lessThan', 'equal', 'endsWith', 'between'}

percent

值的类型必须小于class'bool'>

priority

值的类型必须小于class“int”>

rank

值的类型必须小于class“int”>

stdDev

值的类型必须小于class“int”>

stopIfTrue

值的类型必须小于class'bool'>

tagname = 'cfRule'
text

值的类型必须小于class'str'>

timePeriod

Value must be one of {'last7Days', 'lastWeek', 'lastMonth', 'thisMonth', 'nextWeek', 'yesterday', 'today', 'tomorrow', 'nextMonth', 'thisWeek'}

type

Value must be one of {'containsText', 'beginsWith', 'notContainsErrors', 'containsBlanks', 'duplicateValues', 'notContainsText', 'notContainsBlanks', 'timePeriod', 'top10', 'colorScale', 'aboveAverage', 'expression', 'iconSet', 'uniqueValues', 'containsErrors', 'dataBar', 'cellIs', 'endsWith'}

class openpyxl.formatting.rule.RuleType[源代码]

基类:openpyxl.descriptors.serialisable.Serialisable

cfvo

只能包含声明类型的对象的序列(列表或元组)

class openpyxl.formatting.rule.ValueDescriptor(*args, **kw)[源代码]

基类:openpyxl.descriptors.base.Float

所需类型取决于父级的类型attribue:。-(

大多数值应该是数字,但也可以是单元格引用