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 {'max', 'percentile', 'percent', 'num', 'min', 'formula'}

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 {'3TrafficLights1', '4ArrowsGray', '3Signs', '4Rating', '3Arrows', '5Rating', '4Arrows', '5Quarters', '3Symbols', '3TrafficLights2', '3Symbols2', '5Arrows', '4TrafficLights', '4RedToBlack', '5ArrowsGray', '3Flags', '3ArrowsGray'}

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 {'notBetween', 'beginsWith', 'greaterThan', 'greaterThanOrEqual', 'endsWith', 'notEqual', 'equal', 'lessThanOrEqual', 'lessThan', 'containsText', 'between', 'notContains'}

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 {'nextWeek', 'thisWeek', 'thisMonth', 'yesterday', 'today', 'last7Days', 'lastMonth', 'lastWeek', 'nextMonth', 'tomorrow'}

type

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

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

基类:openpyxl.descriptors.serialisable.Serialisable

cfvo

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

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

基类:openpyxl.descriptors.base.Float

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

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