def CellIsRule(operator=None, formula=None, stopIfTrue=None, font=None, border=None, fill=None):
 expand = {'>': 'greaterThan', '>=': 'greaterThanOrEqual', '<': 'lessThan', '<=': 'lessThanOrEqual', '=': 'equal', '==': 'equal', '!=': 'notEqual'}
 operator = expand.get(operator, operator)
 rule = Rule(type='cellIs', operator=operator, formula=formula, stopIfTrue=stopIfTrue)
 rule.dxf = DifferentialStyle(font=font, border=border, fill=fill)
 return rule

def CellIsRule ( operator = None , formula = None , stopIfTrue = None , font = None , border = None , fill = None ) : expand = { '>' : 'greaterThan' , '>=' : 'greaterThanOrEqual' , '<' : 'lessThan' , '<=' : 'lessThanOrEqual' , '=' : 'equal' , '==' : 'equal' , '!=' : 'notEqual' } operator = expand . get ( operator , operator ) rule = Rule ( type = 'cellIs' , operator = operator , formula = formula , stopIfTrue = stopIfTrue ) rule . dxf = DifferentialStyle ( font = font , border = border , fill = fill ) return rule
conditional formatting rule based on cell contents .