title: Python: adding to Excel conditional formatting of type 'containsText'
body: <p>I am trying to add conditional formatting (highlight cell containing pipe character) to Excel using openpyxl (2.5.4) in Python 2.7. I have tried with many variants of code as seen below. None of it worked. Can you point where is error?</p>
  
  <pre><code>import openpyxl
  from openpyxl import formatting, styles, Workbook
  
  wb = openpyxl.load_workbook('export.xlsx')
  sheet = wb['all']
  
  red_text = Font(color='9C0006')
  red_fill = PatternFill(bgColor='FFC7CE')
  </code></pre>
  
  <h3>Variant 1 - code</h3>
  
  <pre><code>sheet.conditional_formatting.add('A1:E4', rule(type='containsText', operator='containsText', text='|', fill=red_fill, font=red_text))
  </code></pre>
  
  <h3>Variant 1 - error</h3>
  
  <pre><code>NameError: name 'rule' is not defined
  </code></pre>
  
  <h3>Variant 2 - code</h3>
  
  <pre><code>sheet.conditional_formatting.add('A1:E4', CellIsRule(type='containsText', operator='containsText', text='|', fill=red_fill, font=red_text))
  </code></pre>
  
  <h3>Variant 2 - error</h3>
  
  <pre><code>TypeError: CellIsRule() got an unexpected keyword argument 'type'
  </code></pre>
  
  <h3>Variant 3 - code</h3>
  
  <pre><code>sheet.conditional_formatting.add('A1:E4', formatting.rule.CellIsRule(type='containsText', operator='containsText', text='|', fill=red_fill, font=red_text))
  </code></pre>
  
  <h3>Variant 3 - error</h3>
  
  <pre><code>TypeError: CellIsRule() got an unexpected keyword argument 'type'
  </code></pre>
  
  <h3>Variant 4 - code</h3>
  
  <pre><code>sheet.conditional_formatting.add('A1:E4', formatting.rule.CellIsRule(operator='containsText', text='|', fill=red_fill, font=red_text))
  </code></pre>
  
  <h3>Variant 4 - error</h3>
  
  <pre><code>TypeError: CellIsRule() got an unexpected keyword argument 'text'
  </code></pre>