openpyxl.styles.fills module

class openpyxl.styles.fills.Fill[source]

Bases: openpyxl.descriptors.serialisable.Serialisable

Base class

classmethod from_tree(el)[source]
tagname = 'fill'
class openpyxl.styles.fills.GradientFill(type='linear', degree=0, left=0, right=0, top=0, bottom=0, stop=(), fill_type=None)[source]

Bases: openpyxl.styles.fills.Fill

bottom

Values must be of type <type ‘float’>

degree

Values must be of type <type ‘float’>

fill_type

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

left

Values must be of type <type ‘float’>

right

Values must be of type <type ‘float’>

stop

A sequence of primitive types that are stored as a single attribute. “val” is the default attribute

tagname = 'gradientFill'
to_tree(tagname=None, namespace=None, idx=None)[source]
top

Values must be of type <type ‘float’>

type

Value must be one of set([‘path’, ‘linear’])

class openpyxl.styles.fills.PatternFill(patternType=None, fgColor=<openpyxl.styles.colors.Color object> Parameters: tint=0.0, auto=None, theme=None, rgb='00000000', indexed=None, type='rgb', bgColor=<openpyxl.styles.colors.Color object> Parameters: tint=0.0, auto=None, theme=None, rgb='00000000', indexed=None, type='rgb', fill_type=None, start_color=None, end_color=None)[source]

Bases: openpyxl.styles.fills.Fill

Area fill patterns for use in styles. Caution: if you do not specify a fill_type, other attributes will have no effect !

bgColor

Values must be of type <class ‘openpyxl.styles.colors.Color’>

end_color

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

fgColor

Values must be of type <class ‘openpyxl.styles.colors.Color’>

fill_type

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

patternType

Value must be one of set([‘darkDown’, ‘lightGray’, ‘darkHorizontal’, ‘gray0625’, ‘lightGrid’, ‘lightVertical’, ‘solid’, ‘darkGray’, ‘gray125’, ‘darkGrid’, ‘darkUp’, ‘mediumGray’, ‘darkTrellis’, ‘lightDown’, ‘lightUp’, ‘lightHorizontal’, ‘darkVertical’, ‘lightTrellis’])

start_color

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

tagname = 'patternFill'
to_tree(tagname=None, idx=None)[source]