0% found this document useful (0 votes)
197 views283 pages

Openpyxl

This document is the documentation for openpyxl, a Python library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files. It provides information on using openpyxl to work with Excel files, including tutorials, code samples, and API documentation. The document covers topics like installation, reading and writing files, working with styles, charts, and formulas. It also includes sections for developers on testing and contributing code to the openpyxl project.

Uploaded by

PAULO SOUZA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
197 views283 pages

Openpyxl

This document is the documentation for openpyxl, a Python library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files. It provides information on using openpyxl to work with Excel files, including tutorials, code samples, and API documentation. The document covers topics like installation, reading and writing files, working with styles, charts, and formulas. It also includes sections for developers on testing and contributing code to the openpyxl project.

Uploaded by

PAULO SOUZA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 283

openpyxl Documentation

Release 2.4.0

See AUTHORS

November 21, 2015


Contents

1 Introduction 3
1.1 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Sample code: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 User List 5

3 How to Contribute Code 7

4 Other ways to help 9

5 Installation 11

6 Working with a checkout 13

7 Usage examples 15
7.1 Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.2 Cookbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.3 Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.4 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.5 Read/write large files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.6 Working with styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.7 Conditional Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.8 Data Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.9 Parsing Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

8 Information for Developers 71


8.1 Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
8.2 Testing on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

9 API Documentation 77
9.1 openpyxl package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

10 Indices and tables 217

11 Release Notes 219


11.1 2.4.0 (unreleased) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
11.2 2.3.2 (unreleased) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
11.3 2.3.1 (2015-11-20) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
11.4 2.3.0 (2015-10-20) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

i
11.5 2.3.0-b2 (2015-09-04) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
11.6 2.3.0-b1 (2015-06-29) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
11.7 2.2.6 (unreleased) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
11.8 2.2.5 (2015-06-29) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
11.9 2.2.4 (2015-06-17) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
11.10 2.2.3 (2015-05-26) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
11.11 2.2.2 (2015-04-28) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
11.12 2.2.1 (2015-03-31) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
11.13 2.2.0 (2015-03-11) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
11.14 2.2.0-b1 (2015-02-18) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
11.15 2.1.5 (2015-02-18) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
11.16 2.1.4 (2014-12-16) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
11.17 2.1.3 (2014-12-09) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
11.18 2.1.2 (2014-10-23) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
11.19 2.1.1 (2014-10-08) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
11.20 2.1.0 (2014-09-21) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.21 2.0.5 (2014-08-08) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.22 2.0.4 (2014-06-25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.23 2.0.3 (2014-05-22) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.24 2.0.2 (2014-05-13) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.25 2.0.1 (2014-05-13) brown bag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.26 2.0.0 (2014-05-13) brown bag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.27 1.8.6 (2014-05-05) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.28 1.8.5 (2014-03-25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.29 1.8.4 (2014-02-25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.30 1.8.3 (2014-02-09) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.31 1.8.2 (2014-01-17) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
11.32 1.8.1 (2014-01-14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
11.33 1.8.0 (2014-01-08) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
11.34 1.7.0 (2013-10-31) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

Python Module Index 233

ii
openpyxl Documentation, Release 2.4.0

Author Eric Gazoni, Charlie Clark


Source code http://bitbucket.org/openpyxl/openpyxl/src
Issues http://bitbucket.org/openpyxl/openpyxl/issues
Generated November 21, 2015
License MIT/Expat
Version 2.4.0

Contents 1
openpyxl Documentation, Release 2.4.0

2 Contents
CHAPTER 1

Introduction

Openpyxl is a Python library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files.
It was born from lack of existing library to read/write natively from Python the Office Open XML format.
All kudos to the PHPExcel team as openpyxl was initially based on PHPExcel.

1.1 Support

This is an open source project, maintained by volunteers in their spare time. This may well mean that particular
features or functions that you would like are missing. But things don’t have to stay that way. You can contribute the
project development yourself or contract a developer for particular features.
Professional support for openpyxl is available from Clark Consulting & Research and Adimian. Donations to the
project to support further development and maintenance are welcome.
Bug reports and feature requests should be submitted using the issue tracker. Please provide a full traceback of any
error you see and if possible a sample file. If for reasons of confidentiality you are unable to make a file publicly
available then contact of one the developers.

1.2 Sample code:


from openpyxl import Workbook
wb = Workbook()

# grab the active worksheet


ws = wb.active

# Data can be assigned directly to cells


ws['A1'] = 42

# Rows can also be appended


ws.append([1, 2, 3])

# Python types will automatically be converted


import datetime
ws['A2'] = datetime.datetime.now()

# Save the file


wb.save("sample.xlsx")

3
openpyxl Documentation, Release 2.4.0

4 Chapter 1. Introduction
CHAPTER 2

User List

Official user list can be found on http://groups.google.com/group/openpyxl-users

5
openpyxl Documentation, Release 2.4.0

6 Chapter 2. User List


CHAPTER 3

How to Contribute Code

Any help will be greatly appreciated, just follow those steps:


1. Please start a new fork (https://bitbucket.org/openpyxl/openpyxl/fork) for each independent feature,
don’t try to fix all problems at the same time, it’s easier for those who will review and merge your changes
;-)
2. Hack hack hack
3. Don’t forget to add unit tests for your changes! (YES, even if it’s a one-liner, changes without tests
will not be accepted.) There are plenty of examples in the source if you lack know-how or inspiration.
4. If you added a whole new feature, or just improved something, you can be proud of it, so add yourself
to the AUTHORS file :-)
5. Let people know about the shiny thing you just implemented, update the docs!
6. When it’s done, just issue a pull request (click on the large “pull request” button on your repository) and
wait for your code to be reviewed, and, if you followed all theses steps, merged into the main repository.
For further information see Development

7
openpyxl Documentation, Release 2.4.0

8 Chapter 3. How to Contribute Code


CHAPTER 4

Other ways to help

There are several ways to contribute, even if you can’t code (or can’t code well):
• triaging bugs on the bug tracker: closing bugs that have already been closed, are not relevant, cannot be repro-
duced, ...
• updating documentation in virtually every area: many large features have been added (mainly about charts and
images at the moment) but without any documentation, it’s pretty hard to do anything with it
• proposing compatibility fixes for different versions of Python: we support 2.6 to 3.5, so if it does not work on
your environment, let us know :-)

9
openpyxl Documentation, Release 2.4.0

10 Chapter 4. Other ways to help


CHAPTER 5

Installation

Install openpyxl using pip. It is advisable to do this in a Python virtualenv without system packages:
$ pip install openpyxl

Note: There is support for the popular lxml library which will be used if it is installed. This is particular useful when
creating large files.

Warning: To be able to include images (jpeg, png, bmp,...) into an openpyxl file, you will also need the “pillow”
library that can be installed with:

$ pip install pillow

or browse https://pypi.python.org/pypi/Pillow/, pick the latest version and head to the bottom of the page for Win-
dows binaries.

11
openpyxl Documentation, Release 2.4.0

12 Chapter 5. Installation
CHAPTER 6

Working with a checkout

Sometimes you might want to work with the checkout of a particular version. This may be the case if bugs have been
fixed but a release has not yet been made.
$ pip hg+https://bitbucket.org/openpyxl/[email protected]#egg=openpyxl

13
openpyxl Documentation, Release 2.4.0

14 Chapter 6. Working with a checkout


CHAPTER 7

Usage examples

7.1 Tutorial

7.1.1 Manipulating a workbook in memory

Create a workbook

There is no need to create a file on the filesystem to get started with openpyxl. Just import the Workbook class and
start using it
>>> from openpyxl import Workbook
>>> wb = Workbook()

A workbook is always created with at least one worksheet. You can get it by using the
openpyxl.workbook.Workbook.active() property
>>> ws = wb.active

Note: This function uses the _active_sheet_index property, set to 0 by default. Unless you modify its value, you will
always get the first worksheet by using this method.

You can also create new worksheets by using the openpyxl.workbook.Workbook.create_sheet()


method
>>> ws1 = wb.create_sheet() # insert at the end (default)
# or
>>> ws2 = wb.create_sheet(0) # insert at first position

Sheets are given a name automatically when they are created. They are numbered in sequence (Sheet, Sheet1, Sheet2,
...). You can change this name at any time with the title property:
ws.title = "New Title"

The background color of the tab holding this title is white by default. You can change this providing an RRGGBB
color code to the sheet_properties.tabColor property:
ws.sheet_properties.tabColor = "1072BA"

Once you gave a worksheet a name, you can get it as a key of the workbook or using the
openpyxl.workbook.Workbook.get_sheet_by_name() method

15
openpyxl Documentation, Release 2.4.0

>>> ws3 = wb["New Title"]


>>> ws4 = wb.get_sheet_by_name("New Title")
>>> ws is ws3 is ws4
True

You can review the names of all worksheets of the workbook with the
openpyxl.workbook.Workbook.get_sheet_names() method
>>> print(wb.get_sheet_names())
['Sheet2', 'New Title', 'Sheet1']

You can loop through worksheets


>>> for sheet in wb:
... print(sheet.title)

Playing with data

Accessing one cell

Now we know how to access a worksheet, we can start modifying cells content.
Cells can be accessed directly as keys of the worksheet
>>> c = ws['A4']

This will return the cell at A4 or create one if it does not exist yet. Values can be directly assigned
>>> ws['A4'] = 4

There is also the openpyxl.worksheet.Worksheet.cell() method:


>>> c = ws.cell('A4')

You can also access a cell using row and column notation:
>>> d = ws.cell(row = 4, column = 2)

Note: When a worksheet is created in memory, it contains no cells. They are created when first accessed. This way
we don’t create objects that would never be accessed, thus reducing the memory footprint.

Warning: Because of this feature, scrolling through cells instead of accessing them directly will create them all
in memory, even if you don’t assign them a value.
Something like

>>> for i in range(1,101):


... for j in range(1,101):
... ws.cell(row = i, column = j)

will create 100x100 cells in memory, for nothing.


However, there is a way to clean all those unwanted cells, we’ll see that later.

Accessing many cells

Ranges of cells can be accessed using slicing

16 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

>>> cell_range = ws['A1':'C2']

You can also use the openpyxl.worksheet.Worksheet.iter_rows() method:


>>> tuple(ws.iter_rows('A1:C2'))
((<Cell Sheet1.A1>, <Cell Sheet1.B1>, <Cell Sheet1.C1>),
(<Cell Sheet1.A2>, <Cell Sheet1.B2>, <Cell Sheet1.C2>))

>>> for row in ws.iter_rows('A1:C2'):


... for cell in row:
... print cell
<Cell Sheet1.A1>
<Cell Sheet1.B1>
<Cell Sheet1.C1>
<Cell Sheet1.A2>
<Cell Sheet1.B2>
<Cell Sheet1.C2>

If you need to iterate through all the rows or columns of a file, you can instead use the
openpyxl.worksheet.Worksheet.rows() property:
>>> ws = wb.active
>>> ws['C9'] = 'hello world'
>>> ws.rows
((<Cell Sheet.A1>, <Cell Sheet.B1>, <Cell Sheet.C1>),
(<Cell Sheet.A2>, <Cell Sheet.B2>, <Cell Sheet.C2>),
(<Cell Sheet.A3>, <Cell Sheet.B3>, <Cell Sheet.C3>),
(<Cell Sheet.A4>, <Cell Sheet.B4>, <Cell Sheet.C4>),
(<Cell Sheet.A5>, <Cell Sheet.B5>, <Cell Sheet.C5>),
(<Cell Sheet.A6>, <Cell Sheet.B6>, <Cell Sheet.C6>),
(<Cell Sheet.A7>, <Cell Sheet.B7>, <Cell Sheet.C7>),
(<Cell Sheet.A8>, <Cell Sheet.B8>, <Cell Sheet.C8>),
(<Cell Sheet.A9>, <Cell Sheet.B9>, <Cell Sheet.C9>))

or the openpyxl.worksheet.Worksheet.columns() property:


>>> ws.columns
((<Cell Sheet.A1>,
<Cell Sheet.A2>,
<Cell Sheet.A3>,
<Cell Sheet.A4>,
<Cell Sheet.A5>,
<Cell Sheet.A6>,
...
<Cell Sheet.B7>,
<Cell Sheet.B8>,
<Cell Sheet.B9>),
(<Cell Sheet.C1>,
<Cell Sheet.C2>,
<Cell Sheet.C3>,
<Cell Sheet.C4>,
<Cell Sheet.C5>,
<Cell Sheet.C6>,
<Cell Sheet.C7>,
<Cell Sheet.C8>,
<Cell Sheet.C9>))

7.1. Tutorial 17
openpyxl Documentation, Release 2.4.0

Data storage

Once we have a openpyxl.cell.Cell, we can assign it a value:


>>> c.value = 'hello, world'
>>> print(c.value)
'hello, world'

>>> d.value = 3.14


>>> print(d.value)
3.14

You can also enable type and format inference:


>>> wb = Workbook(guess_types=True)
>>> c.value = '12%'
>>> print(c.value)
0.12

>>> import datetime


>>> d.value = datetime.datetime.now()
>>> print d.value
datetime.datetime(2010, 9, 10, 22, 25, 18)

>>> c.value = '31.50'


>>> print(c.value)
31.5

7.1.2 Saving to a file

The simplest and safest way to save a workbook is by using the openpyxl.workbook.Workbook.save()
method of the openpyxl.workbook.Workbook object:
>>> wb = Workbook()
>>> wb.save('balances.xlsx')

Warning: This operation will overwrite existing files without warning.

Note: Extension is not forced to be xlsx or xlsm, although you might have some trouble opening it directly with
another application if you don’t use an official extension.
As OOXML files are basically ZIP files, you can also end the filename with .zip and open it with your favourite ZIP
archive manager.

You can specify the attribute as_template=True, to save the document as a template
>>> wb = load_workbook('document.xlsx')
>>> wb.save('document_template.xltx', as_template=True)

or specify the attribute as_template=False (by default), to save the document template (or document) as document.
>>> wb = load_workbook('document_template.xltx')
>>> wb.save('document.xlsx', as_template=False)

>>> wb = load_workbook('document.xlsx')
>>> wb.save('new_document.xlsx', as_template=False)

18 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

Warning: You should monitor the data attributes and document extensions for saving documents in the document
templates and vice versa, otherwise the result table engine can not open the document.

Note: The following will fail:


>>> wb = load_workbook('document.xlsx')
>>> # Need to save with the extension *.xlsx
>>> wb.save('new_document.xlsm')
>>> # MS Excel can't open the document
>>>
>>> # or
>>>
>>> # Need specify attribute keep_vba=True
>>> wb = load_workbook('document.xlsm')
>>> wb.save('new_document.xlsm')
>>> # MS Excel can't open the document
>>>
>>> # or
>>>
>>> wb = load_workbook('document.xltm', keep_vba=True)
>>> # If us need template document, then we need specify extension as *.xltm.
>>> # If us need document, then we need specify attribute as_template=False.
>>> wb.save('new_document.xlsm', as_template=True)
>>> # MS Excel can't open the document

7.1.3 Loading from a file

The same way as writing, you can import openpyxl.load_workbook() to open an existing workbook:
>>> from openpyxl import load_workbook
>>> wb2 = load_workbook('test.xlsx')
>>> print wb2.get_sheet_names()
['Sheet2', 'New Title', 'Sheet1']

This ends the tutorial for now, you can proceed to the Simple usage section

7.2 Cookbook

7.2.1 Simple usage

Write a workbook

>>> from openpyxl import Workbook


>>> from openpyxl.compat import range
>>> from openpyxl.cell import get_column_letter
>>>
>>> wb = Workbook()
>>>
>>> dest_filename = 'empty_book.xlsx'
>>>
>>> ws1 = wb.active
>>> ws1.title = "range names"

7.2. Cookbook 19
openpyxl Documentation, Release 2.4.0

>>>
>>> for row in range(1, 40):
... ws1.append(range(600))
>>>
>>> ws2 = wb.create_sheet(title="Pi")
>>>
>>> ws2['F5'] = 3.14
>>>
>>> ws3 = wb.create_sheet(title="Data")
>>> for row in range(10, 20):
... for col in range(27, 54):
... _ = ws3.cell(column=col, row=row, value="%s" % get_column_letter(col))
>>> print(ws3['AA10'].value)
AA
>>> wb.save(filename = dest_filename)

Write a workbook from *.xltx as *.xlsx

>>> from openpyxl import load_workbook


>>>
>>>
>>> wb = load_workbook('sample_book.xltx')
>>> ws = wb.active
>>> ws['D2'] = 42
>>>
>>> wb.save('sample_book.xlsx')
>>>
>>> # or you can overwrite the current document template
>>> # wb.save('sample_book.xltx')

Write a workbook from *.xltm as *.xlsm

>>> from openpyxl import load_workbook


>>>
>>>
>>> wb = load_workbook('sample_book.xltm', keep_vba=True)
>>> ws = wb.active
>>> ws['D2'] = 42
>>>
>>> wb.save('sample_book.xlsm')
>>>
>>> # or you can overwrite the current document template
>>> # wb.save('sample_book.xltm')

Read an existing workbook

>>> from openpyxl import load_workbook


>>> wb = load_workbook(filename = 'empty_book.xlsx')
>>> sheet_ranges = wb['range names']
>>> print(sheet_ranges['D18'].value)
3

Note: There are several flags that can be used in load_workbook.

20 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

• guess_types will enable or disable (default) type inference when reading cells.
• data_only controls whether cells with formulae have either the formula (default) or the value stored the last time
Excel read the sheet.
• keep_vba controls whether any Visual Basic elements are preserved or not (default). If they are preserved they
are still not editable.

Warning: openpyxl does currently not read all possible items in an Excel file so images and charts will be lost
from existing files if they are opened and saved with the same name.

Using number formats

>>> import datetime


>>> from openpyxl import Workbook
>>> wb = Workbook()
>>> ws = wb.active
>>> # set date using a Python datetime
>>> ws['A1'] = datetime.datetime(2010, 7, 21)
>>>
>>> ws['A1'].number_format
'yyyy-mm-dd h:mm:ss'
>>> # You can enable type inference on a case-by-case basis
>>> wb.guess_types = True
>>> # set percentage using a string followed by the percent sign
>>> ws['B1'] = '3.14%'
>>> wb.guess_types = False
>>> ws['B1'].value
0.031400000000000004
>>>
>>> ws['B1'].number_format
'0%'

Using formulae

>>> from openpyxl import Workbook


>>> wb = Workbook()
>>> ws = wb.active
>>> # add a simple formula
>>> ws["A1"] = "=SUM(1, 1)"
>>> wb.save("formula.xlsx")

Warning: NB you must use the English name for a function and function arguments must be separated by commas
and not other punctuation such as semi-colons.

openpyxl never evaluates formula but it is possible to check the name of a formula:
>>> from openpyxl.utils import FORMULAE
>>> "HEX2DEC" in FORMULAE
True

If you’re trying to use a formula that isn’t known this could be because you’re using a formula that was not included
in the initial specification. Such formulae must be prefixed with xlfn. to work.

7.2. Cookbook 21
openpyxl Documentation, Release 2.4.0

Merge / Unmerge cells

>>> from openpyxl.workbook import Workbook


>>>
>>> wb = Workbook()
>>> ws = wb.active
>>>
>>> ws.merge_cells('A1:B1')
>>> ws.unmerge_cells('A1:B1')
>>>
>>> # or
>>> ws.merge_cells(start_row=2,start_column=1,end_row=2,end_column=4)
>>> ws.unmerge_cells(start_row=2,start_column=1,end_row=2,end_column=4)

Inserting an image

>>> from openpyxl import Workbook


>>> from openpyxl.drawing.image import Image
>>>
>>> wb = Workbook()
>>> ws = wb.active
>>> ws['A1'] = 'You should see three logos below'

>>> # create an image


>>> img = Image('logo.png')

>>> # add to worksheet and anchor next to cells


>>> ws.add_image(img, 'A1')
>>> wb.save('logo.xlsx')

Fold columns (outline)

>>> import openpyxl


>>> wb = openpyxl.Workbook()
>>> ws = wb.create_sheet()
>>> ws.column_dimensions.group('A','D', hidden=True)
>>> wb.save('group.xlsx')

7.3 Charts

7.3.1 Charts

Warning: Openpyxl currently supports chart creation within a worksheet only. Charts in existing workbooks will
be lost.

Chart types

The following charts are available:

22 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

Area Charts

2D Area Charts Area charts are similar to line charts with the addition that the area underneath the plotted line is
filled. Different variants are available by setting the grouping to “standard”, “stacked” or “percentStacked”; “standard”
is the default.
from openpyxl import Workbook
from openpyxl.chart import (
AreaChart,
Reference,
Series,
)

wb = Workbook()
ws = wb.active

rows = [
['Number', 'Batch 1', 'Batch 2'],
[2, 40, 30],
[3, 40, 25],
[4, 50, 30],
[5, 30, 10],
[6, 25, 5],
[7, 50, 10],
]

for row in rows:


ws.append(row)

chart = AreaChart()
chart.title = "Area Chart"
chart.style = 13
chart.x_axis.title = 'Test'
chart.y_axis.title = 'Percentage'

cats = Reference(ws, min_col=1, min_row=1, max_row=7)


data = Reference(ws, min_col=2, min_row=1, max_col=3, max_row=7)
chart.add_data(data, titles_from_data=True)
chart.set_categories(cats)

ws.add_chart(chart, "A10")

wb.save("area.xlsx")

7.3. Charts 23
openpyxl Documentation, Release 2.4.0

3D Area Charts You can also create 3D area charts


from openpyxl import Workbook
from openpyxl.chart import (
AreaChart3D,
Reference,
Series,
)

wb = Workbook()
ws = wb.active

rows = [
['Number', 'Batch 1', 'Batch 2'],
[2, 30, 40],
[3, 25, 40],
[4 ,30, 50],
[5 ,10, 30],
[6, 5, 25],
[7 ,10, 50],
]

for row in rows:

24 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

ws.append(row)

chart = AreaChart3D()
chart.title = "Area Chart"
chart.style = 13
chart.x_axis.title = 'Test'
chart.y_axis.title = 'Percentage'
chart.legend = None

cats = Reference(ws, min_col=1, min_row=1, max_row=7)


data = Reference(ws, min_col=2, min_row=1, max_col=3, max_row=7)
chart.add_data(data, titles_from_data=True)
chart.set_categories(cats)

ws.add_chart(chart, "A10")

wb.save("area3D.xlsx")

This produces a simple 3D area chart where third axis can be used to replace the legend:

7.3. Charts 25
openpyxl Documentation, Release 2.4.0

Bar and Column Charts

In bar charts values are plotted as either horizontal bars or vertical columns.

Vertical, Horizontal and Stacked Bar Charts


Note: The following settings affect the different chart types.
Switch between vertical and horizontal bar charts by setting type to col or bar respectively.
When using stacked charts the overlap needs to be set to 100.
If bars are horizontal, x and y axes are revesed.

from openpyxl import Workbook


from openpyxl.chart import BarChart, Series, Reference

wb = Workbook(write_only=True)
ws = wb.create_sheet()

rows = [
('Number', 'Batch 1', 'Batch 2'),
(2, 10, 30),
(3, 40, 60),
(4, 50, 70),
(5, 20, 10),
(6, 10, 40),
(7, 50, 30),
]

26 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

for row in rows:


ws.append(row)

chart1 = BarChart()
chart1.type = "col"
chart1.style = 10
chart1.title = "Bar Chart"
chart1.y_axis.title = 'Test number'
chart1.x_axis.title = 'Sample length (mm)'

data = Reference(ws, min_col=2, min_row=1, max_row=7, max_col=3)


cats = Reference(ws, min_col=1, min_row=2, max_row=7)
chart1.add_data(data, titles_from_data=True)
chart1.set_categories(cats)
chart1.shape = 4
ws.add_chart(chart1, "A10")

from copy import deepcopy

chart2 = deepcopy(chart1)
chart2.style = 11
chart2.type = "bar"
chart2.title = "Horizontal Bar Chart"

ws.add_chart(chart2, "G10")

chart3 = deepcopy(chart1)
chart3.type = "col"
chart3.style = 12
chart3.grouping = "stacked"
chart3.overlap = 100
chart3.title = 'Stacked Chart'

ws.add_chart(chart3, "A27")

chart4 = deepcopy(chart1)
chart4.type = "bar"
chart4.style = 13
chart4.grouping = "percentStacked"
chart4.overlap = 100
chart4.title = 'Percent Stacked Chart'

ws.add_chart(chart4, "G27")

wb.save("bar.xlsx")

This will produce four charts illustrating the various possibilities.

3D Bar Charts You can also create 3D bar charts


from openpyxl import Workbook
from openpyxl.chart import (
Reference,
Series,

7.3. Charts 27
openpyxl Documentation, Release 2.4.0

BarChart3D,
)

wb = Workbook()
ws = wb.active

rows = [
(None, 2013, 2014),
("Apples", 5, 4),
("Oranges", 6, 2),
("Pears", 8, 3)
]

for row in rows:


ws.append(row)

data = Reference(ws, min_col=2, min_row=1, max_col=3, max_row=4)


titles = Reference(ws, min_col=1, min_row=2, max_row=4)
chart = BarChart3D()
chart.title = "3D Bar Chart"
chart.add_data(data=data, titles_from_data=True)
chart.set_categories(titles)

ws.add_chart(chart, "E5")
wb.save("bar3d.xlsx")

This produces a simple 3D bar chart

Bubble Charts

Bubble charts are similar to scatter charts but use a third dimension to determine the size of the bubbles. Charts can
include multiple series.
"""
Sample bubble chart
"""

from openpyxl import Workbook


from openpyxl.chart import Series, Reference, BubbleChart

wb = Workbook()

28 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

ws = wb.active

rows = [
("Number of Products", "Sales in USD", "Market share"),
(14, 12200, 15),
(20, 60000, 33),
(18, 24400, 10),
(22, 32000, 42),
(),
(12, 8200, 18),
(15, 50000, 30),
(19, 22400, 15),
(25, 25000, 50),
]

for row in rows:


ws.append(row)

chart = BubbleChart()
chart.style = 18 # use a preset style

# add the first series of data


xvalues = Reference(ws, min_col=1, min_row=2, max_row=5)
yvalues = Reference(ws, min_col=2, min_row=2, max_row=5)
size = Reference(ws, min_col=3, min_row=2, max_row=5)
series = Series(values=yvalues, xvalues=xvalues, zvalues=size, title="2013")
chart.series.append(series)

# add the second


xvalues = Reference(ws, min_col=1, min_row=7, max_row=10)
yvalues = Reference(ws, min_col=2, min_row=7, max_row=10)
size = Reference(ws, min_col=3, min_row=7, max_row=10)
series = Series(values=yvalues, xvalues=xvalues, zvalues=size, title="2014")
chart.series.append(series)

# place the chart starting in cell E1


ws.add_chart(chart, "E1")
wb.save("bubble.xlsx")

This will produce bubble chart with two series and should look something like this

Line Charts

7.3. Charts 29
openpyxl Documentation, Release 2.4.0

Line Charts Line charts allow data to be plotted against a fixed axis. They are similar to scatter charts, the main
difference is that with line charts each data series is plotted against the same values. Different kinds of axes can be
used for the secondary axes.
Similar to bar charts there are three kinds of line charts: standard, stacked and percentStacked.
from datetime import date

from openpyxl import Workbook


from openpyxl.chart import (
LineChart,
Reference,
)
from openpyxl.chart.axis import DateAxis

wb = Workbook()
ws = wb.active

rows = [
['Date', 'Batch 1', 'Batch 2', 'Batch 3'],
[date(2015,9, 1), 40, 30, 25],
[date(2015,9, 2), 40, 25, 30],
[date(2015,9, 3), 50, 30, 45],
[date(2015,9, 4), 30, 25, 40],
[date(2015,9, 5), 25, 35, 30],
[date(2015,9, 6), 20, 40, 35],
]

for row in rows:


ws.append(row)

c1 = LineChart()
c1.title = "Line Chart"
c1.style = 13
c1.y_axis.title = 'Size'
c1.x_axis.title = 'Test Number'

data = Reference(ws, min_col=2, min_row=1, max_col=4, max_row=7)


c1.add_data(data, titles_from_data=True)

# Style the lines


s1 = c1.series[0]
s1.marker.symbol = "triangle"
s1.marker.graphicalProperties.solidFill = "FF0000" # Marker filling
s1.marker.graphicalProperties.line.solidFill = "FF0000" # Marker outline

s1.graphicalProperties.line.noFill = True

s2 = c1.series[1]
s2.graphicalProperties.line.solidFill = "00AAAA"
s2.graphicalProperties.line.dashStyle = "sysDot"
s2.graphicalProperties.line.width = 100050 # width in EMUs

s2 = c1.series[2]
s2.smooth = True # Make the line smooth

ws.add_chart(c1, "A10")

from copy import deepcopy

30 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

stacked = deepcopy(c1)
stacked.grouping = "stacked"
stacked.title = "Stacked Line Chart"
ws.add_chart(stacked, "A27")

percent_stacked = deepcopy(c1)
percent_stacked.grouping = "percentStacked"
percent_stacked.title = "Percent Stacked Line Chart"
ws.add_chart(percent_stacked, "A44")

# Chart with date axis


c2 = LineChart()
c2.title = "Date Axis"
c2.style = 12
c2.y_axis.title = "Size"
c2.y_axis.crossAx = 500
c2.x_axis = DateAxis(crossAx=100)
c2.x_axis.number_format = 'd-mmm'
c2.x_axis.majorTimeUnit = "days"
c2.x_axis.title = "Date"

c2.add_data(data, titles_from_data=True)
dates = Reference(ws, min_col=1, min_row=2, max_row=7)
c2.set_categories(dates)

ws.add_chart(c2, "A61")

wb.save("line.xlsx")

7.3. Charts 31
openpyxl Documentation, Release 2.4.0

32 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

3D Line Charts In 3D line charts the third axis is the same as the legend for the series.
from datetime import date

from openpyxl import Workbook


from openpyxl.chart import (
LineChart3D,
Reference,
)
from openpyxl.chart.axis import DateAxis

wb = Workbook()
ws = wb.active

rows = [
['Date', 'Batch 1', 'Batch 2', 'Batch 3'],
[date(2015,9, 1), 40, 30, 25],
[date(2015,9, 2), 40, 25, 30],
[date(2015,9, 3), 50, 30, 45],
[date(2015,9, 4), 30, 25, 40],
[date(2015,9, 5), 25, 35, 30],
[date(2015,9, 6), 20, 40, 35],
]

for row in rows:


ws.append(row)

c1 = LineChart3D()
c1.title = "3D Line Chart"
c1.legend = None
c1.style = 15
c1.y_axis.title = 'Size'
c1.x_axis.title = 'Test Number'

data = Reference(ws, min_col=2, min_row=1, max_col=4, max_row=7)


c1.add_data(data, titles_from_data=True)

ws.add_chart(c1, "A10")

wb.save("line3D.xlsx")

7.3. Charts 33
openpyxl Documentation, Release 2.4.0

Scatter Charts

Scatter, or xy, charts are similar to some line charts. The main difference is that one series of values is plotted against
another. This is useful where values are unordered.
from openpyxl import Workbook
from openpyxl.chart import (
ScatterChart,
Reference,
Series,
)

wb = Workbook()
ws = wb.active

rows = [
['Size', 'Batch 1', 'Batch 2'],
[2, 40, 30],
[3, 40, 25],
[4, 50, 30],
[5, 30, 25],

34 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

[6, 25, 35],


[7, 20, 40],
]

for row in rows:


ws.append(row)

chart = ScatterChart()
chart.title = "Scatter Chart"
chart.style = 13
chart.x_axis.title = 'Size'
chart.y_axis.title = 'Percentage'

xvalues = Reference(ws, min_col=1, min_row=2, max_row=7)


for i in range(2, 4):
values = Reference(ws, min_col=i, min_row=1, max_row=7)
series = Series(values, xvalues, title_from_data=True)
chart.series.append(series)

ws.add_chart(chart, "A10")

wb.save("scatter.xlsx")

7.3. Charts 35
openpyxl Documentation, Release 2.4.0

Note: The specification says that there are the following types of scatter charts: ‘line’, ‘lineMarker’, ‘marker’,
‘smooth’, ‘smoothMarker’. However, at least in Microsoft Excel, this is just a shortcut for other settings that otherwise
no effect. For consistency with line charts, the style for each series should be set manually.

Pie Charts

Pie Charts Pie charts plot data as slices of a circle with each slice representing the percentage of the whole. Slices
are plotted in a clockwise direction with 0° being at the top of the circle. Pie charts can only take a single series of
data. The title of the chart will default to being the title of the series.
from openpyxl import Workbook

from openpyxl.chart import (


PieChart,
ProjectedPieChart,
Reference
)
from openpyxl.chart.series import DataPoint

data = [
['Pie', 'Sold'],
['Apple', 50],
['Cherry', 30],
['Pumpkin', 10],
['Chocolate', 40],
]

wb = Workbook()
ws = wb.active

for row in data:


ws.append(row)

pie = PieChart()
labels = Reference(ws, min_col=1, min_row=2, max_row=5)
data = Reference(ws, min_col=2, min_row=1, max_row=5)
pie.add_data(data, titles_from_data=True)
pie.set_categories(labels)
pie.title = "Pies sold by category"

# Cut the first slice out of the pie


slice = DataPoint(idx=0, explosion=20)
pie.series[0].data_points = [slice]

ws.add_chart(pie, "D1")

ws = wb.create_sheet(title="Projection")

data = [
['Page', 'Views'],
['Search', 95],
['Products', 4],
['Offers', 0.5],
['Sales', 0.5],
]

36 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

for row in data:


ws.append(row)

projected_pie = ProjectedPieChart()
projected_pie.type = "pie"
projected_pie.splitType = "val" # split by value
labels = Reference(ws, min_col=1, min_row=2, max_row=5)
data = Reference(ws, min_col=2, min_row=1, max_row=5)
projected_pie.add_data(data, titles_from_data=True)
projected_pie.set_categories(labels)

ws.add_chart(projected_pie, "A10")

from copy import deepcopy


projected_bar = deepcopy(projected_pie)
projected_bar.type = "bar"
projected_bar.splitType = 'pos' # split by position

ws.add_chart(projected_bar, "A27")

wb.save("pie.xlsx")

Projected Pie Charts Projected pie charts extract some slices from a pie chart and project them into a second pie
or bar chart. This is useful when there are several smaller items in the data series. The chart can be split according
percent, val(ue) or pos(ition). If nothing is set then the application decides which to use. In addition custom splits can
be defined.

7.3. Charts 37
openpyxl Documentation, Release 2.4.0

38 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

3D Pie Charts Pie charts can also be created with a 3D effect.


from openpyxl import Workbook

from openpyxl.chart import (


PieChart3D,
Reference
)

data = [
['Pie', 'Sold'],
['Apple', 50],
['Cherry', 30],
['Pumpkin', 10],
['Chocolate', 40],
]

wb = Workbook()
ws = wb.active

for row in data:


ws.append(row)

pie = PieChart3D()
labels = Reference(ws, min_col=1, min_row=2, max_row=5)
data = Reference(ws, min_col=2, min_row=1, max_row=5)
pie.add_data(data, titles_from_data=True)
pie.set_categories(labels)
pie.title = "Pies sold by category"

ws.add_chart(pie, "D1")

wb.save("pie3D.xlsx")

Doughnut Charts

Doughnut charts are similar to pie charts except that they use a ring instead of a circle. They can also plot several
series of data as concentric rings.
from openpyxl import Workbook

7.3. Charts 39
openpyxl Documentation, Release 2.4.0

from openpyxl.chart import (


DoughnutChart,
Reference,
Series,
)
from openpyxl.chart.series import DataPoint

data = [
['Pie', 2014, 2015],
['Plain', 40, 50],
['Jam', 2, 10],
['Lime', 20, 30],
['Chocolate', 30, 40],
]

wb = Workbook()
ws = wb.active

for row in data:


ws.append(row)

chart = DoughnutChart()
labels = Reference(ws, min_col=1, min_row=2, max_row=5)
data = Reference(ws, min_col=2, min_row=1, max_row=5)
chart.add_data(data, titles_from_data=True)
chart.set_categories(labels)
chart.title = "Doughnuts sold by category"
chart.style = 26

# Cut the first slice out of the doughnut


slices = [DataPoint(idx=i) for i in range(4)]
plain, jam, lime, chocolate = slices
chart.series[0].data_points = slices
plain.graphicalProperties.solidFill = "FAE1D0"
jam.graphicalProperties.solidFill = "BB2244"
lime.graphicalProperties.solidFill = "22DD22"
chocolate.graphicalProperties.solidFill = "61210B"
chocolate.explosion = 10

ws.add_chart(chart, "E1")

from copy import deepcopy

chart2 = deepcopy(chart)
chart2.title = None
data = Reference(ws, min_col=3, min_row=1, max_row=5)
series2 = Series(data, title_from_data=True)
series2.data_points = slices
chart2.series.append(series2)

ws.add_chart(chart2, "E17")

wb.save("doughnut.xlsx")

40 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

Radar Charts

Data that is arranged in columns or rows on a worksheet can be plotted in a radar chart. Radar charts compare the
aggregate values of multiple data series. It is effectively a projection of an area chart on a circular x-axis.
There are two types of radar chart: standard, where the area is marked with a line; and filled where the where the
whole area is filled. The additional type “marker” has no effect. If markers are desired these can be set for the relevant
series.
from openpyxl import Workbook
from openpyxl.chart import (
RadarChart,
Reference,
)

wb = Workbook()
ws = wb.active

rows = [
['Month', "Bulbs", "Seeds", "Flowers", "Trees & shrubs"],
['Jan', 0, 2500, 500, 0,],
['Feb', 0, 5500, 750, 1500],
['Mar', 0, 9000, 1500, 2500],
['Apr', 0, 6500, 2000, 4000],
['May', 0, 3500, 5500, 3500],
['Jun', 0, 0, 7500, 1500],
['Jul', 0, 0, 8500, 800],
['Aug', 1500, 0, 7000, 550],
['Sep', 5000, 0, 3500, 2500],
['Oct', 8500, 0, 2500, 6000],
['Nov', 3500, 0, 500, 5500],

7.3. Charts 41
openpyxl Documentation, Release 2.4.0

['Dec', 500, 0, 100, 3000 ],


]

for row in rows:


ws.append(row)

chart = RadarChart()
chart.type = "filled"
labels = Reference(ws, min_col=1, min_row=2, max_row=13)
data = Reference(ws, min_col=2, max_col=5, min_row=1, max_row=13)
chart.add_data(data, titles_from_data=True)
chart.set_categories(labels)
chart.style = 26
chart.title = "Garden Centre Sales"
chart.y_axis.delete = True

ws.add_chart(chart, "A17")

wb.save("radar.xlsx")

42 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

Stock Charts

Data that is arranged in columns or rows in a specific order on a worksheet can be plotted in a stock chart. As its
name implies, a stock chart is most often used to illustrate the fluctuation of stock prices. However, this chart may
also be used for scientific data. For example, you could use a stock chart to indicate the fluctuation of daily or annual
temperatures. You must organize your data in the correct order to create stock charts.
The way stock chart data is organized in the worksheet is very important. For example, to create a simple high-
low-close stock chart, you should arrange your data with High, Low, and Close entered as column headings, in that
order.
Although stock charts are a distinct type, the various types are just shortcuts for particular formatting options:

7.3. Charts 43
openpyxl Documentation, Release 2.4.0

• high-low-close is essentially a line chart with no lines and the marker set to XYZ. It also sets hiLoLines to True
• open-high-low-close is the as a high-low-close chart with the marker for each data point set to XZZ and up-
DownLines.
Volume can be added by combining the stock chart with a bar chart for the volume.
from datetime import date

from openpyxl import Workbook

from openpyxl.chart import (


BarChart,
StockChart,
Reference,
Series,
)
from openpyxl.chart.axis import DateAxis, ChartLines
from openpyxl.chart.updown_bars import UpDownBars

wb = Workbook()
ws = wb.active

rows = [
['Date', 'Volume','Open', 'High', 'Low', 'Close'],
['2015-01-01', 20000, 26.2, 27.20, 23.49, 25.45, ],
['2015-01-02', 10000, 25.45, 25.03, 19.55, 23.05, ],
['2015-01-03', 15000, 23.05, 24.46, 20.03, 22.42, ],
['2015-01-04', 2000, 22.42, 23.97, 20.07, 21.90, ],
['2015-01-05', 12000, 21.9, 23.65, 19.50, 21.51, ],
]

for row in rows:


ws.append(row)

# High-low-close
c1 = StockChart()
labels = Reference(ws, min_col=1, min_row=2, max_row=6)
data = Reference(ws, min_col=4, max_col=6, min_row=1, max_row=6)
c1.add_data(data, titles_from_data=True)
c1.set_categories(labels)
for s in c1.series:
s.graphicalProperties.line.noFill = True
# marker for close
s.marker.symbol = "dot"
s.marker.size = 5
c1.title = "High-low-close"
c1.hiLowLines = ChartLines()

# Excel is broken and needs a cache of values in order to display hiLoLines :-/
from openpyxl.chart.data_source import NumData, NumVal
pts = [NumVal(idx=i) for i in range(len(data) - 1)]
cache = NumData(pt=pts)
c1.series[-1].val.numRef.numCache = cache

ws.add_chart(c1, "A10")

# Open-high-low-close
c2 = StockChart()

44 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

data = Reference(ws, min_col=3, max_col=6, min_row=1, max_row=6)


c2.add_data(data, titles_from_data=True)
c2.set_categories(labels)
for s in c2.series:
s.graphicalProperties.line.noFill = True
c2.hiLowLines = ChartLines()
c2.upDownBars = UpDownBars()
c2.title = "Open-high-low-close"

# add dummy cache


c2.series[-1].val.numRef.numCache = cache

ws.add_chart(c2, "G10")

# Create bar chart for volume

bar = BarChart()
data = Reference(ws, min_col=2, min_row=1, max_row=6)
bar.add_data(data, titles_from_data=True)
bar.set_categories(labels)

from copy import deepcopy

# Volume-high-low-close
b1 = deepcopy(bar)
c3 = deepcopy(c1)
c3.y_axis.majorGridlines = None
c3.y_axis.title = "Price"
b1.y_axis.axId = 20
b1.z_axis = c3.y_axis
b1.y_axis.crosses = "max"
b1 += c3

c3.title = "High low close volume"

ws.add_chart(b1, "A27")

## Volume-open-high-low-close
b2 = deepcopy(bar)
c4 = deepcopy(c2)
c4.y_axis.majorGridlines = None
c4.y_axis.title = "Price"
b2.y_axis.axId = 20
b2.z_axis = c4.y_axis
b2.y_axis.crosses = "max"
b2 += c4

ws.add_chart(b2, "G27")

wb.save("stock.xlsx")

7.3. Charts 45
openpyxl Documentation, Release 2.4.0

Warning: Due to a bug in Excel high-low lines will only be shown if at least one of the data series has some
dummy values. This can be done with the following hack:

from openpyxl.chart.data_source import NumData, NumVal


pts = [NumVal(idx=i) for i in range(len(data) - 1)]
cache = NumData(pt=pts)
c1.series[-1].val.numRef.numCache = cache

Surface charts

Data that is arranged in columns or rows on a worksheet can be plotted in a surface chart. A surface chart is useful
when you want to find optimum combinations between two sets of data. As in a topographic map, colors and patterns
indicate areas that are in the same range of values.
By default all surface charts are 3D. 2D wireframe and contour charts are created by setting the rotation and perspec-
tive.
from openpyxl import Workbook
from openpyxl.chart import (
SurfaceChart,
SurfaceChart3D,
Reference,
Series,
)
from openpyxl.chart.axis import SeriesAxis

wb = Workbook()
ws = wb.active

46 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

data = [
[None, 10, 20, 30, 40, 50,],
[0.1, 15, 65, 105, 65, 15,],
[0.2, 35, 105, 170, 105, 35,],
[0.3, 55, 135, 215, 135, 55,],
[0.4, 75, 155, 240, 155, 75,],
[0.5, 80, 190, 245, 190, 80,],
[0.6, 75, 155, 240, 155, 75,],
[0.7, 55, 135, 215, 135, 55,],
[0.8, 35, 105, 170, 105, 35,],
[0.9, 15, 65, 105, 65, 15],
]

for row in data:


ws.append(row)

c1 = SurfaceChart()
ref = Reference(ws, min_col=2, max_col=6, min_row=1, max_row=10)
labels = Reference(ws, min_col=1, min_row=2, max_row=10)
c1.add_data(ref, titles_from_data=True)
c1.set_categories(labels)
c1.title = "Contour"

ws.add_chart(c1, "A12")

from copy import deepcopy

# wireframe
c2 = deepcopy(c1)
c2.wireframe = True
c2.title = "2D Wireframe"

ws.add_chart(c2, "G12")

# 3D Surface
c3 = SurfaceChart3D()
c3.add_data(ref, titles_from_data=True)
c3.set_categories(labels)
c3.title = "Surface"

ws.add_chart(c3, "A29")

c4 = deepcopy(c3)
c4.wireframe = True
c4.title = "3D Wireframe"

ws.add_chart(c4, "G29")

wb.save("surface.xlsx")

7.3. Charts 47
openpyxl Documentation, Release 2.4.0

Creating a chart

Charts are composed of at least one series of one or more data points. Series themselves are comprised of references
to cell ranges.
>>> from openpyxl import Workbook
>>> wb = Workbook()
>>> ws = wb.active
>>> for i in range(10):
... ws.append([i])
>>>
>>> from openpyxl.chart import BarChart, Reference, Series
>>> values = Reference(ws, min_col=1, min_row=1, max_col=1, max_row=10)
>>> chart = BarChart()
>>> chart.add_data(values)
>>> ws.add_chart(chart)
>>> wb.save("SampleChart.xlsx")

Working with axes

Adding a second axis

Adding a second axis actually involves creating a second chart that shares a common x-axis with the first chart but has
a separate y-axis.

48 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

from openpyxl import Workbook


from openpyxl.chart import (
LineChart,
BarChart,
Reference,
Series,
)

wb = Workbook()
ws = wb.active

rows = [
['Aliens', 2, 3, 4, 5, 6, 7],
['Humans', 10, 40, 50, 20, 10, 50],
]

for row in rows:


ws.append(row)

c1 = BarChart()
v1 = Reference(ws, min_col=1, min_row=1, max_col=7)
c1.add_data(v1, titles_from_data=True, from_rows=True)

c1.x_axis.title = 'Days'
c1.y_axis.title = 'Aliens'
c1.y_axis.majorGridlines = None
c1.title = 'Survey results'

# Create a second chart


c2 = LineChart()
v2 = Reference(ws, min_col=1, min_row=2, max_col=7)
c2.add_data(v2, titles_from_data=True, from_rows=True)
c2.y_axis.axId = 200
c2.y_axis.title = "Humans"

# Display y-axis of the second chart on the right by setting it to cross the x-axis at its maximum
c1.y_axis.crosses = "max"
c1 += c2

ws.add_chart(c1, "D4")

wb.save("secondary.xlsx")

This produces a combined line and bar chart looking something like this:

7.3. Charts 49
openpyxl Documentation, Release 2.4.0

Change the chart layout

Changing the layout of plot area and legend

The layout of the chart within the canvas can be set by using the layout property an instance of a layout class.

Chart layout

Size and position The chart can be positioned within its container. x and y adjust position, w and h adjust the size
. The units are proportions of the container. A chart cannot be positioned outside of its container and the width and
height are the dominant constraints: if x + w > 1, then x = 1 - w.
x is the horizontal position from the left y is the vertical position the top h is the height of the chart relative to its
container w is the width of the box

Mode In addition to the size and position the mode for the relevant attribute can also be set to either factor or edge.
Factor is the default:
layout.xMode = edge

Target The layoutTarget can be set to outer or inner. The default is outer:
layout.layoutTarget = inner

Legend layout The position of the legend can be controlled either by setting its position: r, l, t, b, and tr, for
right, left, top, bottom and top right respectively. The default is r.
legend.position = 'tr'

or applying a manual layout:

50 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

legend.layout = ManualLayout()

from openpyxl import Workbook, load_workbook


from openpyxl.chart import ScatterChart, Series, Reference
from openpyxl.chart.layout import Layout, ManualLayout

wb = Workbook()
ws = wb.active

rows = [
['Size', 'Batch 1', 'Batch 2'],
[2, 40, 30],
[3, 40, 25],
[4, 50, 30],
[5, 30, 25],
[6, 25, 35],
[7, 20, 40],
]

for row in rows:


ws.append(row)

ch1 = ScatterChart()
xvalues = Reference(ws, min_col=1, min_row=2, max_row=7)
for i in range(2, 4):
values = Reference(ws, min_col=i, min_row=1, max_row=7)
series = Series(values, xvalues, title_from_data=True)
ch1.series.append(series)

ch1.title = "Default layout"


ch1.style = 13
ch1.x_axis.title = 'Size'
ch1.y_axis.title = 'Percentage'
ch1.legend.position = 'r'

ws.add_chart(ch1, "B10")

from copy import deepcopy

# Half-size chart, bottom right


ch2 = deepcopy(ch1)
ch2.title = "Manual chart layout"
ch2.legend.position = "tr"
ch2.layout=Layout(
manualLayout=ManualLayout(
x=0.25, y=0.25,
h=0.5, w=0.5,
)
)
ws.add_chart(ch2, "H10")

# Half-size chart, centred


ch3 = deepcopy(ch1)
ch3.layout = Layout(
ManualLayout(
x=0.25, y=0.25,
h=0.5, w=0.5,

7.3. Charts 51
openpyxl Documentation, Release 2.4.0

xMode="edge",
yMode="edge",
)
)
ch3.title = "Manual chart layout, edge mode"
ws.add_chart(ch3, "B27")

# Manually position the legend bottom left


ch4 = deepcopy(ch1)
ch4.title = "Manual legend layout"
ch4.legend.layout = Layout(
manualLayout=ManualLayout(
yMode='edge',
xMode='edge',
x=0, y=0.9,
h=0.1, w=0.5
)
)

ws.add_chart(ch4, "H27")

wb.save("chart_layout.xlsx")

This produces four charts illustrating various possibilities:

Styling charts

Adding Patterns

Whole data series and individual data points can be extensively styled through the graphicalProperties. Getting things
just right may take some time.
from openpyxl import Workbook
from openpyxl.chart import BarChart, Reference

52 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

from openpyxl.chart.marker import DataPoint

from openpyxl.drawing.fill import PatternFillProperties, ColorChoice

wb = Workbook()
ws = wb.active

rows = [
("Sample",),
(1,),
(2,),
(3,),
(2,),
(3,),
(3,),
(1,),
(2,),
]

for r in rows:
ws.append(r)

c = BarChart()
data = Reference(ws, min_col=1, min_row=1, max_row=8)
c.add_data(data, titles_from_data=True)
c.title = "Chart with patterns"

# set a pattern for the whole series


series = c.series[0]
fill = PatternFillProperties(prst="pct5")
fill.foreground = ColorChoice(prstClr="red")
fill.background = ColorChoice(prstClr="blue")
series.graphicalProperties.pattFill = fill

# set a pattern for a 6th data point (0-indexed)


pt = DataPoint(idx=5)
pt.graphicalProperties.pattFill = PatternFillProperties(prst="ltHorz")
series.dPt.append(pt)

ws.add_chart(c, "C1")

wb.save("pattern.xlsx")

7.3. Charts 53
openpyxl Documentation, Release 2.4.0

Advanced charts

Charts can be combined to create new charts:

Gauge Charts

Gauge charts combine a pie chart and a doughnut chart to create a “gauge”. The first chart is a doughnut chart with
four slices. The first three slices correspond to the colours of the gauge; the fourth slice, which is half of the doughnut,
is made invisible.
A pie chart containing three slices is added. The first and third slice are invisible so that the second slice can act as the
needle on the gauge.
The effects are done using the graphical properties of individual data points in a data series.
from openpyxl import Workbook

from openpyxl.chart import PieChart, DoughnutChart, Series, Reference


from openpyxl.chart.series import DataPoint

data = [
["Donut", "Pie"],
[25, 75],
[50, 1],
[25, 124],
[100],
]

# based on http://www.excel-easy.com/examples/gauge-chart.html

wb = Workbook()
ws = wb.active
for row in data:
ws.append(row)

# First chart is a doughnut chart


c1 = DoughnutChart(firstSliceAng=270, holeSize=50)

54 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

c1.title = "Code coverage"


c1.legend = None

ref = Reference(ws, min_col=1, min_row=2, max_row=5)


s1 = Series(ref, title_from_data=False)

slices = [DataPoint(idx=i) for i in range(4)]


slices[0].graphicalProperties.solidFill = "FF3300" # red
slices[1].graphicalProperties.solidFill = "FCF305" # yellow
slices[2].graphicalProperties.solidFill = "1FB714" # green
slices[3].graphicalProperties.noFill = True # invisible

s1.data_points = slices
c1.series = [s1]

# Second chart is a pie chart


c2 = PieChart(firstSliceAng=270)
c2.legend = None

ref = Reference(ws, min_col=2, min_row=2, max_col=2, max_row=4)


s2 = Series(ref, title_from_data=False)

slices = [DataPoint(idx=i) for i in range(3)]


slices[0].graphicalProperties.noFill = True # invisible
slices[1].graphicalProperties.solidFill = "000000" # black needle
slices[2].graphicalProperties.noFill = True # invisible
s2.data_points = slices
c2.series = [s2]

c1 += c2 # combine charts

ws.add_chart(c1, "D1")

wb.save("gauge.xlsx")

Using chartsheets

Charts can be added to special worksheets called chartsheets:

7.3. Charts 55
openpyxl Documentation, Release 2.4.0

Chartsheets

Chartsheets are special worksheets which only contain charts. All the data for the chart must be on a different work-
sheet.
from openpyxl import Workbook

from openpyxl.chart import PieChart, Reference, Series

wb = Workbook()
ws = wb.active
cs = wb.create_chartsheet()

rows = [
["Bob", 3],
["Harry", 2],
["James", 4],
]

for row in rows:


ws.append(row)

chart = PieChart()
labels = Reference(ws, min_col=1, min_row=1, max_row=3)
data = Reference(ws, min_col=2, min_row=1, max_row=3)
chart.series = (Series(data),)
chart.title = "PieChart"

cs.add_chart(chart)

wb.save("demo.xlsx")

56 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

7.4 Comments

7.4.1 Comments

Warning: Openpyxl currently supports the reading and writing of comment text only. Formatting information is
lost. Comments are not currently supported if use_iterators=True is used.

Adding a comment to a cell

Comments have a text attribute and an author attribute, which must both be set
>>> from openpyxl import Workbook
>>> from openpyxl.comments import Comment
>>> wb = Workbook()
>>> ws = wb.active
>>> comment = ws["A1"].comment
>>> comment = Comment('This is the comment text', 'Comment Author')
>>> comment.text
'This is the comment text'
>>> comment.author
'Comment Author'

You cannot assign the same Comment object to two different cells. Doing so raises an AttributeError.

7.4. Comments 57
openpyxl Documentation, Release 2.4.0

>>> from openpyxl import Workbook


>>> from openpyxl.comments import Comment
>>> wb=Workbook()
>>> ws=wb.active
>>> comment = Comment("Text", "Author")
>>> ws["A1"].comment = comment
>>> ws["B2"].comment = comment
Traceback (most recent call last):
AttributeError: Comment already assigned to A1 in worksheet Sheet. Cannot
assign a comment to more than one cell

Loading and saving comments

Comments present in a workbook when loaded are stored in the comment attribute of their respective cells automati-
cally. Formatting information such as font size, bold and italics are lost, as are the original dimensions and position of
the comment’s container box.
Comments remaining in a workbook when it is saved are automatically saved to the workbook file.

7.5 Read/write large files

7.5.1 Read-only mode

Sometimes, you will need to open or write extremely large XLSX files, and the common routines in openpyxl won’t
be able to handle that load. Fortunately, there are two modes that enable you to read and write unlimited amounts of
data with (near) constant memory consumption.
Introducing openpyxl.worksheet.read_only.ReadOnlyWorksheet:
from openpyxl import load_workbook
wb = load_workbook(filename='large_file.xlsx', read_only=True)
ws = wb['big_data'] # ws is now an IterableWorksheet

for row in ws.rows:


for cell in row:
print(cell.value)

Warning:
• openpyxl.worksheet.read_only.ReadOnlyWorksheet is read-only

Cells returned are not regular openpyxl.cell.cell.Cell but openpyxl.cell.read_only.ReadOnlyCell.

7.5.2 Write-only mode

Here again, the regular openpyxl.worksheet.worksheet.Worksheet has been replaced by a faster alterna-
tive, the openpyxl.writer.write_only.WriteOnlyWorksheet. When you want to dump large amounts
of data, you might find optimized writer helpful.
>>> from openpyxl import Workbook
>>> wb = Workbook(write_only=True)
>>> ws = wb.create_sheet()
>>>

58 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

>>> # now we'll fill it with 100 rows x 200 columns


>>>
>>> for irow in range(100):
... ws.append(['%d' % i for i in range(200)])
>>> # save the file
>>> wb.save('new_big_file.xlsx')

If you want to have cells with styles or comments then use a openpyxl.writer.write_only.WriteOnlyCell()
>>> from openpyxl import Workbook
>>> wb = Workbook(write_only=True)
>>> ws = wb.create_sheet()
>>> from openpyxl.writer.write_only import WriteOnlyCell
>>> from openpyxl.comments import Comment
>>> from openpyxl.styles import Style, Font
>>> cell = WriteOnlyCell(ws, value="hello world")
>>> cell.font = Font(name='Courrier', size=36)
>>> cell.comment = Comment(text="A comment", author="Author's Name")

This will append one new row with 3 cells, one text cell with custom font and font size, a float and an empty cell that
will be discarded anyway.

Warning:
• Those worksheet only have an append() method, it’s not possible to access independent cells directly
(through cell() or range()). They are write-only.
• It is able to export unlimited amount of data (even more than Excel can handle actually), while keeping
memory usage under 10Mb.
• A workbook using the optimized writer can only be saved once. After that, ev-
ery attempt to save the workbook or append() to an existing worksheet will raise an
openpyxl.utils.exceptions.WorkbookAlreadySaved exception.

7.6 Working with styles

7.6.1 Working with styles

Introduction

Styles are used to change the look of your data while displayed on screen. They are also used to determine the number
format being used for a given cell or range of cells.
Styles can be applied to the following aspects:
• font to set font size, color, underlining, etc.
• fill to set a pattern or color gradient
• border to set borders on a cell
• cell alignment
• protection
The following are the default values
>>> from openpyxl.styles import PatternFill, Border, Side, Alignment, Protection, Font
>>> font = Font(name='Calibri',

7.6. Working with styles 59


openpyxl Documentation, Release 2.4.0

... size=11,
... bold=False,
... italic=False,
... vertAlign=None,
... underline='none',
... strike=False,
... color='FF000000')
>>> fill = PatternFill(fill_type=None,
... start_color='FFFFFFFF',
... end_color='FF000000')
>>> border = Border(left=Side(border_style=None,
... color='FF000000'),
... right=Side(border_style=None,
... color='FF000000'),
... top=Side(border_style=None,
... color='FF000000'),
... bottom=Side(border_style=None,
... color='FF000000'),
... diagonal=Side(border_style=None,
... color='FF000000'),
... diagonal_direction=0,
... outline=Side(border_style=None,
... color='FF000000'),
... vertical=Side(border_style=None,
... color='FF000000'),
... horizontal=Side(border_style=None,
... color='FF000000')
... )
>>> alignment=Alignment(horizontal='general',
... vertical='bottom',
... text_rotation=0,
... wrap_text=False,
... shrink_to_fit=False,
... indent=0)
>>> number_format = 'General'
>>> protection = Protection(locked=True,
... hidden=False)
>>>

Styles are shared between objects and once they have been assigned they cannot be changed. This stops unwanted
side-effects such as changing the style for lots of cells when instead of only one.
>>> from openpyxl.styles import colors
>>> from openpyxl.styles import Font, Color
>>> from openpyxl.styles import colors
>>> from openpyxl import Workbook
>>> wb = Workbook()
>>> ws = wb.active
>>>
>>> a1 = ws['A1']
>>> d4 = ws['D4']
>>> ft = Font(color=colors.RED)
>>> a1.font = ft
>>> d4.font = ft
>>>
>>> a1.font.italic = True # is not allowed
>>>
>>> # If you want to change the color of a Font, you need to reassign it::

60 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

>>>
>>> a1.font = Font(color=colors.RED, italic=True) # the change only affects A1

Copying styles

Styles can also be copied


>>> from openpyxl.styles import Font
>>>
>>> ft1 = Font(name='Arial', size=14)
>>> ft2 = ft1.copy(name="Tahoma")
>>> ft1.name
'Arial'
>>> ft2.name
'Tahoma'
>>> ft2.size # copied from the
14.0

Basic Font Colors

Colors are usually RGB or aRGB hexvalues. The colors module contains some constants
>>> from openpyxl.styles import Font
>>> from openpyxl.styles.colors import RED
>>> font = Font(color=RED)
>>> font = Font(color="FFBB00")

There is also support for legacy indexed colors as well as themes and tints
>>> from openpyxl.styles.colors import Color
>>> c = Color(indexed=32)
>>> c = Color(theme=6, tint=0.5)

Applying Styles

Styles are applied directly to cells


>>> from openpyxl.workbook import Workbook
>>> from openpyxl.styles import Font, Fill
>>> wb = Workbook()
>>> ws = wb.active
>>> c = ws['A1']
>>> c.font = Font(size=12)

Styles can also applied to columns and rows but note that this applies only to cells created (in Excel) after the file is
closed. If you want to apply styles to entire rows and columns then you must apply the style to each cell yourself. This
is a restriction of the file format:
>>> col = ws.column_dimensions['A']
>>> col.font = Font(bold=True)
>>> row = ws.row_dimensions[1]
>>> row.font = Font(underline="single")

7.6. Working with styles 61


openpyxl Documentation, Release 2.4.0

Edit Page Setup

>>> from openpyxl.workbook import Workbook


>>>
>>> wb = Workbook()
>>> ws = wb.active
>>>
>>> ws.page_setup.orientation = ws.ORIENTATION_LANDSCAPE
>>> ws.page_setup.paperSize = ws.PAPERSIZE_TABLOID
>>> ws.page_setup.fitToHeight = 0
>>> ws.page_setup.fitToWidth = 1

Edit Print Options

>>> from openpyxl.workbook import Workbook


>>>
>>> wb = Workbook()
>>> ws = wb.active
>>>
>>> ws.print_options.horizontalCentered = True
>>> ws.print_options.verticalCentered = True

Header / Footer

Headers and footers use their own formatting language. This is fully supported when writing them but, due to the
complexity and the possibility of nesting, only partially when reading them.
>>> from openpyxl.workbook import Workbook
>>>
>>> wb = Workbook()
>>> ws = wb.worksheets[0]
>>>
>>> ws.header_footer.center_header.text = 'My Excel Page'
>>> ws.header_footer.center_header.font_size = 14
>>> ws.header_footer.center_header.font_name = "Tahoma,Bold"
>>> ws.header_footer.center_header.font_color = "CC3366"

# Or just >>> ws.header_footer.right_footer.text = ‘My Right Footer’

Worksheet Additional Properties

These are advanced properties for particular behaviours, the most used ones are the “fitTopage” page setup property
and the tabColor that define the background color of the worksheet tab.
Available properties for worksheet: “codeName”, “enableFormatConditionsCalculation”, “filterMode”, “published”,
“syncHorizontal”, “syncRef”, “syncVertical”, “transitionEvaluation”, “transitionEntry”, “tabColor”. Available fields
for page setup properties: “autoPageBreaks”, “fitToPage”. Available fields for outline properties: “applyStyles”,
“summaryBelow”, “summaryRight”, “showOutlineSymbols”.
see http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.sheetproperties%28v=office.14%29.aspx_
for details.
..note:: By default, outline properties are intitialized so you can directly modify each of their 4 attributes, while page
setup properties don’t. If you want modify the latter, you should first initialize a PageSetupPr object with the
required parameters. Once done, they can be directly modified by the routine later if needed.

62 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

>>> from openpyxl.workbook import Workbook


>>> from openpyxl.worksheet.properties import WorksheetProperties, PageSetupProperties
>>>
>>> wb = Workbook()
>>> ws = wb.active
>>>
>>> wsprops = ws.sheet_properties
>>> wsprops.tabColor = "1072BA"
>>> wsprops.filterMode = False
>>> wsprops.PageSetupProperties = PageSetupProperties(fitToPage=True, autoPageBreaks=False)
>>> wsprops.outlinePr.summaryBelow = False
>>> wsprops.outlinePr.applyStyles = True
>>> wsprops.PageSetupProperties.autoPageBreaks = True

7.7 Conditional Formatting

7.7.1 Conditional Formatting

Excel supports three different types of conditional formatting: builtins, standard and custom. Builtins combine specific
rules with predefined styles. Standard conditional formats combine specific rules with custom formatting. In additional
it is possible to define custom formulae for applying custom formats using differential styles.

Note: The syntax for the different rules varies so much that it is not possible for openpyxl to know whether a rule
makes sense or not.

The basic syntax for creating a formatting rule is:


>>> from openpyxl.formatting import Rule
>>> from openpyxl.styles import Font, PatternFill, Border
>>> from openpyxl.styles.differential import DifferentialStyle
>>> dxf = DifferentialStyle(font=Font(bold=True), fill=PatternFill(start_color='FFEE1111', end_color=
>>> rule = Rule(type='cellIs', dxf=dxf, formula=["10"])

Because the signatures for some rules can be quite verbose there are also some convenience factories for creating them.

Builtin formats

The builtins conditional formats are:


• ColorScale
• IconSet
• DataBar
Builtin formats contain a sequence of formatting settings which combine a type with an integer for comparison.
Possible types are: ‘num’, ‘percent’, ‘max’, ‘min’, ‘formula’, ‘percentile’.

ColorScale

You can have color scales with 2 or 3 colors. 2 color scales produce a gradient from one color to another; 3 color
scales use an additional color for 2 gradients.
The full syntax for creating a ColorScale rule is:

7.7. Conditional Formatting 63


openpyxl Documentation, Release 2.4.0

>>> from openpyxl.formatting.rule import ColorScale, FormatObject


>>> from openpyxl.styles import Color
>>> first = FormatObject(type='min')
>>> last = FormatObject(type='max')
>>> # colors match the format objects:
>>> colors = [Color('FFAA0000'), Color('FF00AA00')]
>>> cs2 = ColorScale(cfvo=[first, last], color=colors)
>>> # a three color scale would extend the sequences
>>> mid = FormatObject(type='num', val=40)
>>> colors.insert(1, Color('FF00AA00'))
>>> cs3 = ColorScale(cfvo=[first, mid, last], color=colors)
>>> # create a rule with the color scale
>>> from openpyxl.formatting.rule import Rule
>>> rule = Rule(type='colorScale', colorScale=cs3)

There is a convenience function for creating ColorScale rules


>>> from openpyxl.formatting.rule import ColorScaleRule
>>> rule = ColorScaleRule(start_type='percentile', start_value=10, start_color='FFAA0000',
... mid_type='percentile', mid_value=50, mid_color='FF0000AA',
... end_type='percentile', end_value=90, end_color='FF00AA00')

IconSet

Choose from the following set of icons: ‘3Arrows’, ‘3ArrowsGray’, ‘3Flags’, ‘3TrafficLights1’, ‘3TrafficLights2’,
‘3Signs’, ‘3Symbols’, ‘3Symbols2’, ‘4Arrows’, ‘4ArrowsGray’, ‘4RedToBlack’, ‘4Rating’, ‘4TrafficLights’, ‘5Arrows’,
‘5ArrowsGray’, ‘5Rating’, ‘5Quarters’
The full syntax for creating an IconSet rule is:
>>> from openpyxl.formatting.rule import IconSet, FormatObject
>>> first = FormatObject(type='percent', val=0)
>>> second = FormatObject(type='percent', val=33)
>>> third = FormatObject(type='percent', val=67)
>>> iconset = IconSet(iconSet='3TrafficLights1', cfvo=[first, second, third], showValue=None, percent
>>> # assign the icon set to a rule
>>> from openpyxl.formatting.rule import Rule
>>> rule = Rule(type='iconSet', iconSet=iconset)

There is a convenience function for creating IconSet rules:


>>> from openpyxl.formatting.rule import IconSetRule
>>> rule = IconSetRule('5Arrows', 'percent', [10, 20, 30, 40, 50], showValue=None, percent=None, reve

DataBar

Currently, openpyxl supports the DataBars as defined in the original specification. Borders and directions were added
in a later extension.
The full syntax for creating a DataBar rule is:
>>> from openpyxl.formatting.rule import DataBar, FormatObject
>>> first = FormatObject(type='min')
>>> second = FormatObject(type='max')
>>> data_bar = DataBar(cfvo=[first, second], color="FF638EC6", showValue=None, minLength=None, maxLen
>>> # assign the data bar to a rule

64 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

>>> from openpyxl.formatting.rule import Rule


>>> rule = Rule(type='dataBar', dataBar=data_bar)

There is a convenience function for creating DataBar rules:


>>> from openpyxl.formatting.rule import DataBarRule
>>> rule = DataBarRule(start_type='percentile', start_value=10, end_type='percentile', end_value='90'
... color="FF638EC6", showValue="None", minLength=None, maxLength=None)

Standard conditional formats

The standard conditional formats are:


• Average
• Percent
• Unique or duplicate
• Value
• Rank
>>> from openpyxl import Workbook
>>> from openpyxl.styles import Color, PatternFill, Font, Border
>>> from openpyxl.formatting.rule import ColorScaleRule, CellIsRule, FormulaRule
>>>
>>> wb = Workbook()
>>> ws = wb.active
>>>
>>> # Create fill
>>> redFill = PatternFill(start_color='FFEE1111',
... end_color='FFEE1111',
... fill_type='solid')
>>>
>>> # Add a two-color scale
>>> # add2ColorScale(range_string, start_type, start_value, start_color, end_type, end_value, end_col
>>> # Takes colors in excel 'FFRRGGBB' style.
>>> ws.conditional_formatting.add('A1:A10',
... ColorScaleRule(start_type='min', start_color='FFAA0000',
... end_type='max', end_color='FF00AA00')
... )
>>>
>>> # Add a three-color scale
>>> ws.conditional_formatting.add('B1:B10',
... ColorScaleRule(start_type='percentile', start_value=10, start_color='FFAA0000',
... mid_type='percentile', mid_value=50, mid_color='FF0000AA',
... end_type='percentile', end_value=90, end_color='FF00AA00')
... )
>>>
>>> # Add a conditional formatting based on a cell comparison
>>> # addCellIs(range_string, operator, formula, stopIfTrue, wb, font, border, fill)
>>> # Format if cell is less than 'formula'
>>> ws.conditional_formatting.add('C2:C10',
... CellIsRule(operator='lessThan', formula=['C$1'], stopIfTrue=True, fill=redFill))
>>>
>>> # Format if cell is between 'formula'
>>> ws.conditional_formatting.add('D2:D10',
... CellIsRule(operator='between', formula=['1','5'], stopIfTrue=True, fill=redFill))

7.7. Conditional Formatting 65


openpyxl Documentation, Release 2.4.0

>>>
>>> # Format using a formula
>>> ws.conditional_formatting.add('E1:E10',
... FormulaRule(formula=['ISBLANK(E1)'], stopIfTrue=True, fill=redFill))
>>>
>>> # Aside from the 2-color and 3-color scales, format rules take fonts, borders and fills for styli
>>> myFont = Font()
>>> myBorder = Border()
>>> ws.conditional_formatting.add('E1:E10',
... FormulaRule(formula=['E1=0'], font=myFont, border=myBorder, fill=redFill))
>>>
>>> wb.save("test.xlsx")

7.8 Data Validation

7.8.1 Validating cells

You can add data validation to a workbook but currently cannot read existing data validation.

Examples

>>> from openpyxl import Workbook


>>> from openpyxl.worksheet.datavalidation import DataValidation
>>>
>>> # Create the workbook and worksheet we'll be working with
>>> wb = Workbook()
>>> ws = wb.active
>>>
>>> # Create a data-validation object with list validation
>>> dv = DataValidation(type="list", formula1='"Dog,Cat,Bat"', allow_blank=True)
>>>
>>> # Optionally set a custom error message
>>> dv.error ='Your entry is not in the list'
>>> dv.errorTitle = 'Invalid Entry'
>>>
>>> # Optionally set a custom prompt message
>>> dv.prompt = 'Please select from the list'
>>> dv.promptTitle = 'List Selection'
>>>
>>> # Add the data-validation object to the worksheet
>>> ws.add_data_validation(dv)

>>> # Create some cells, and add them to the data-validation object
>>> c1 = ws["A1"]
>>> c1.value = "Dog"
>>> dv.add(c1)
>>> c2 = ws["A2"]
>>> c2.value = "An invalid value"
>>> dv.add(c2)
>>>
>>> # Or, apply the validation to a range of cells
>>> dv.ranges.append('B1:B1048576')
>>>
>>> # Write the sheet out. If you now open the sheet in Excel, you'll find that

66 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

>>> # the cells have data-validation applied.


>>> wb.save("test.xlsx")

Other validation examples

Any whole number:


dv = DataValidation(type="whole")

Any whole number above 100:


dv = DataValidation(type="whole",
operator="greaterThan",
formula1=100)

Any decimal number:


dv = DataValidation(type="decimal")

Any decimal number between 0 and 1:


dv = DataValidation(type="decimal",
operator="between",
formula1=0,
formula2=1)

Any date:
dv = DataValidation(type="date")

or time:
dv = DataValidation(type="time")

Any string at most 15 characters:


dv = DataValidation(type="textLength",
operator="lessThanOrEqual"),
formula1=15)

Custom rule:
dv = DataValidation(type="custom",
formula1"=SOMEFORMULA")

Note: See http://www.contextures.com/xlDataVal07.html for custom rules

7.9 Parsing Formulas

7.9.1 Parsing Formulas

openpyxl supports limited parsing of formulas embedded in cells. The openpyxl.formula package contains a Tokenizer
class to break formulas into their consitutuent tokens. Usage is as follows:

7.9. Parsing Formulas 67


openpyxl Documentation, Release 2.4.0

>>> from openpyxl.formula import Tokenizer


>>> tok = Tokenizer("""=IF($A$1,"then True",MAX(DEFAULT_VAL,'Sheet 2'!B1))""")
>>> tok.parse()
>>> print("\n".join("%12s%11s%9s" % (t.value, t.type, t.subtype) for t in tok.items))
IF( FUNC OPEN
$A$1 OPERAND RANGE
, SEP ARG
"then True" OPERAND TEXT
, SEP ARG
MAX( FUNC OPEN
DEFAULT_VAL OPERAND RANGE
, SEP ARG
'Sheet 2'!B1 OPERAND RANGE
) FUNC CLOSE
) FUNC CLOSE

As shown above, tokens have three attributes of interest:


• .value: The substring of the formula that produced this token
• .type: The type of token this represents. Can be one of
– Token.LITERAL: If the cell does not contain a formula, its value is represented by a single LITERAL
token.
– Token.OPERAND: A generic term for any value in the Excel formula. (See .subtype below for more
details).
– Token.FUNC: Function calls are broken up into tokens for the opener (e.g., SUM(), followed by the
arguments, followed by the closer (i.e., )). The function name and opening parenthesis together form one
FUNC token, and the matching parenthesis forms another FUNC token.
– Token.ARRAY: Array literals (enclosed between curly braces) get two ARRAY tokens each, one for the
opening { and one for the closing }.
– Token.PAREN: When used for grouping subexpressions (and not to denote function calls), parentheses
are tokenized as PAREN tokens (one per character).
– Token.SEP: These tokens are created from either commas (,) or semicolons (;). Commas create SEP
tokens when they are used to separate function arguments (e.g., SUM(a,b)) or when they are used to
separate array elements (e.g., {a,b}). (They have another use as an infix operator for joining ranges).
Semicolons are always used to separate rows in an array literal, so always create SEP tokens.
– Token.OP_PRE: Designates a prefix unary operator. Its value is always + or -
– Token.OP_IN: Designates an infix binary operator. Possible values are >=, <=, <>, =, >, <, *, /, +, -,
^, or &.
– Token.OP_POST: Designates a postfix unary operator. Its value is always %.
– Token.WSPACE: Created for any whitespace encountered. Its value is always a single space, regardless
of how much whitespace is found.
• .subtype: Some of the token types above use the subtype to provide additional information about the token.
Possible subtypes are:
– Token.TEXT, Token.NUMBER, Token.LOGICAL, Token.ERROR, Token.RANGE: these subtypes
describe the various forms of OPERAND found in formulae. LOGICAL is either TRUE or FALSE, RANGE
is either a named range or a direct reference to another range. TEXT, NUMBER, and ERROR all refer to
literal values in the formula

68 Chapter 7. Usage examples


openpyxl Documentation, Release 2.4.0

– Token.OPEN and Token.CLOSE: these two subtypes are used by PAREN, FUNC, and ARRAY, to de-
scribe whether the token is opening a new subexpression or closing it.
– Token.ARG and Token.ROW: are used by the SEP tokens, to distinguish between the comma and semi-
colon. Commas produce tokens of subtype ARG whereas semicolons produce tokens of subtype ROW

7.9. Parsing Formulas 69


openpyxl Documentation, Release 2.4.0

70 Chapter 7. Usage examples


CHAPTER 8

Information for Developers

8.1 Development

With the ongoing development of openpyxl, there is occasional information useful to assist developers.

8.1.1 What is suppoprted

The primary aim of openpyxl is to support reading and writing Microsoft Excel 2010 files. Where possible support for
files generated by other libraries or programs is available but this is not guaranteed.

8.1.2 Supporting different Python versions

We have a small library of utility functions to support development for Python 2 and 3. This is openpyxl.compat for
Python and openpyxl.xml for XML functions.

8.1.3 Coding style

Use PEP-8 except when implementing attributes for roundtripping but always use Python data conventions (boolean,
None, etc.) Note exceptions in docstrings.

8.1.4 Getting the source

The source code is hosted on bitbucket.org. You can get it using a Mercurial client and the following URL.
$ hg clone https://bitbucket.org/openpyxl/openpyxl
$ hg up 2.4
$ virtualenv openpyxl
$ cd openpyxl
$ source bin/activate
$ pip install -U -r requirements.txt
$ python setup.py develop

71
openpyxl Documentation, Release 2.4.0

8.1.5 Testing

Contributions without tests will not be accepted.


We use pytest as the test runner with pytest-cov for coverage information and pytest-flakes for static code analysis.

Coverage

The goal is 100 % coverage for unit tests - data types and utility functions. Coverage information can be obtained
using
py.test --cov openpyxl

Organisation

Tests should be preferably at package / module level e.g openpyxl/cell. This makes testing and getting statistics for
code under development easier:
py.test --cov openpyxl/cell openpyxl/cell

Checking XML

Use the openpyxl.tests.helper.compare_xml function to compare generated and expected fragments of


XML.

Schema validation

When working on code to generate XML it is possible to validate that the generated XML conforms to the published
specification. Note, this won’t necessarily guarantee that everything is fine but is preferable to reverse engineering!

Microsoft Tools

Along with the SDK, Microsoft also has a “Productivity Tool” for working with Office OpenXML.
This allows you to quickly inspect or compare whole Excel files. Unfortunately, validation errors contain many false
positives.
Please see Testing on Windows for additional information on setting up and testing on Windows.

8.1.6 Contributing

Contributions in the form of pull requests are always welcome. Don’t forget to add yourself to the list of authors!

8.1.7 Branch naming convention

We use a “major.minor.patch” numbering system, ie. 2.4.0. Development branches are named after “major.minor”
releases. In general, API change will only happen major releases but there will be exceptions. Always communicate
API changes to the mailing list before making them. If you are changing an API try and an implement a fallback (with
deprecation warning) for the old behaviour.
The “default branch” is used for releases and always has changes from a development branch merged in. It should
never be the target for a pull request.

72 Chapter 8. Information for Developers


openpyxl Documentation, Release 2.4.0

8.1.8 Pull Requests

Pull requests should be submitted to the current, unreleased development branch. Eg. if the current release is 2.4.0,
pull requests should be made to the 2.4 branch. Exceptions are bug fixes to released versions which should be made
to the relevant release branch and merged upstream into development.
Please use tox to test code for different submissions before making a pull request. This is especially important for
picking up problems across Python versions.

Documentation

Remember to update the documentation when adding or changing features. Check that documentation is syntactically
correct.
tox -e doc

8.1.9 Benchmarking

Benchmarking and profiling are ongoing tasks. Contributions to these are very welcome as we know there is a lot to
do.

Memory Use

There is a tox profile for long-running memory benchmarks using the memory_utils package.
tox -e memory

Pympler

As openpyxl does not include any internal memory benchmarking tools, the python pympler package was used during
the testing of styles to profile the memory usage in openpyxl.reader.excel.read_style_table():
# in openpyxl/reader/style.py
from pympler import muppy, summary

def read_style_table(xml_source):
...
if cell_xfs is not None: # ~ line 47
initialState = summary.summarize(muppy.get_objects()) # Capture the initial state
for index, cell_xfs_node in enumerate(cell_xfs_nodes):
...
table[index] = new_style
finalState = summary.summarize(muppy.get_objects()) # Capture the final state
diff = summary.get_diff(initialState, finalState) # Compare
summary.print_(diff)

pympler.summary.print_() prints to the console a report of object memory usage, allowing the comparison
of different methods and examination of memory usage. A useful future development would be to construct a bench-
marking package to measure the performance of different components.

8.1. Development 73
openpyxl Documentation, Release 2.4.0

8.2 Testing on Windows

Although openpyxl itself is pure Python and should run on any Python, we do use some libraries that require compiling
for tests and documentation. The setup for testing on Windows is somewhat different.

8.2.1 Getting started

Once you have installed the versions of Python (2.6, 2.7, 3.3, 3.4) you should setup a development environment for
testing so that you do not adversely affect the system install.

8.2.2 Setting up a development environment

First of all you should checkout a copy of the repository. Atlassian provides a nice GUI client SourceTree that allows
you to do this with a single-click from the browser.
By default the repository will be installed under your user folder. eg. c:UsersYOURUSERopenpyxl
Switch to the branch you want to work on by double-clicking it. The default branch should never be used for develop-
ment work.

Creating a virtual environment

You will need to manually install virtualenv. This is best done by first installing pip. open a command line and
download the script “get_pip.py” to your preferred Python folder:
bitsadmin /transfer pip http://bootstrap.pypa.io/get-pip.py c:\python27\get-pip.py # change the path

Install pip (it needs to be at least pip 6.0):


python get_pip.py

Now you can install virtualenv:


Scripts\pip install virtualenv
Scripts\virtualenv c:\Users\YOURUSER\openpyxl

8.2.3 lxml

openpyxl needs lxml in order to run the tests. Unfortunately, automatic installation of lxml on Windows is tricky as
pip defaults to try and compile it. This can be avoided by using pre-compiled versions of the library.
1. In the command line switch to your repository folder:
cd c:\Users\YOURUSER\openpyxl

2. Activate the virtualenv:


Scripts\activate

3. Install a development version of openpyxl:


python setup.py develop

4. Download all the relevant lxml Windows wheels

74 Chapter 8. Information for Developers


openpyxl Documentation, Release 2.4.0

5. Move all these files to a folder called “downloads” in your openpyxl checkout
6. Install the project requirements:
pip install --download downloads -r requirements.txt
pip install --no-index --find-links downloads -r requirements.txt

To run tests for the virtualenv:


py.test -xrf openpyxl # the flag will stop testing at the first error

8.2.4 tox

We use tox to run the tests on different Python versions and configurations. Using it is as simple as:
set PIP_FIND_LINKS=downloads
tox openpyxl

8.2. Testing on Windows 75


openpyxl Documentation, Release 2.4.0

76 Chapter 8. Information for Developers


CHAPTER 9

API Documentation

9.1 openpyxl package

9.1.1 Subpackages

openpyxl.cell package

Submodules

openpyxl.cell.cell module
class openpyxl.cell.cell.Cell(worksheet, column=None, row=None, value=None, col_idx=None,
style_array=None)
Bases: openpyxl.styles.styleable.StyleableObject
Describes cell associated properties.
Properties of interest include style, type, value, and address.
ERROR_CODES = (‘#NULL!’, ‘#DIV/0!’, ‘#VALUE!’, ‘#REF!’, ‘#NAME?’, ‘#NUM!’, ‘#N/A’)
TYPE_BOOL = ‘b’
TYPE_ERROR = ‘e’
TYPE_FORMULA = ‘f’
TYPE_FORMULA_CACHE_STRING = ‘str’
TYPE_INLINE = ‘inlineStr’
TYPE_NULL = ‘n’
TYPE_NUMERIC = ‘n’
TYPE_STRING = ‘s’
VALID_TYPES = (‘s’, ‘f’, ‘n’, ‘b’, ‘n’, ‘inlineStr’, ‘e’, ‘str’)
anchor
returns the expected position of a cell in pixels from the top-left of the sheet. For example, A1 anchor
should be (0,0).
Return type tuple(int, int)
base_date

77
openpyxl Documentation, Release 2.4.0

check_error(value)
Tries to convert Error” else N/A
check_string(value)
Check string coding, length, and line break character
col_idx
column
comment
Returns the comment associated with this cell
Return type openpyxl.comments.Comment
coordinate
data_type
encoding
guess_types
hyperlink
Return the hyperlink target or an empty string
internal_value
Always returns the value for excel.
is_date
Whether the value is formatted as a date
Return type bool
offset(row=0, column=0)
Returns a cell location relative to this cell.
Parameters
• row (int) – number of rows to offset
• column (int) – number of columns to offset
Return type openpyxl.cell.Cell
parent
row
set_explicit_value(value=None, data_type=’s’)
Coerce values according to their explicit type
value
Get or set the value held in the cell. ‘:rtype: depends on the value (string, float, int or ‘
‘datetime.datetime)’

openpyxl.cell.interface module
class openpyxl.cell.interface.AbstractCell(value=None)
Bases: abc.ABC
base_date
comment
coordinate

78 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

encoding
guess_types
internal_value
is_date
number_format
offset(row=0, column=0)
style
value

openpyxl.cell.read_only module
class openpyxl.cell.read_only.ReadOnlyCell(sheet, row, column, value, data_type=’n’,
style_id=0)
Bases: object
alignment
base_date
border
column
coordinate
data_type
fill
font
internal_value
is_date
number_format
parent
protection
row
shared_strings
style
style_array
value

openpyxl.cell.text module
class openpyxl.cell.text.InlineFont(rFont=None, charset=None, family=None, b=None,
i=None, strike=None, outline=None, shadow=None,
condense=None, extend=None, color=None, sz=None,
u=None, vertAlign=None, scheme=None)
Bases: openpyxl.styles.fonts.Font
Font for inline text because, yes what you need are different objects with the same elements but different con-
straints.

9.1. openpyxl package 79


openpyxl Documentation, Release 2.4.0

b
Values must be of type <class ‘bool’>
charset
Values must be of type <class ‘int’>
color
Values must be of type <class ‘openpyxl.styles.colors.Color’>
condense
Values must be of type <class ‘bool’>
extend
Values must be of type <class ‘bool’>
family
Values must be of type <class ‘float’>
i
Values must be of type <class ‘bool’>
outline
Values must be of type <class ‘bool’>
rFont
Values must be of type <class ‘str’>
scheme
Value must be one of {‘minor’, ‘major’}
shadow
Values must be of type <class ‘bool’>
strike
Values must be of type <class ‘bool’>
sz
Values must be of type <class ‘float’>
tagname = ‘RPrElt’
u
Value must be one of {‘single’, ‘doubleAccounting’, ‘double’, ‘singleAccounting’}
vertAlign
Value must be one of {‘superscript’, ‘subscript’, ‘baseline’}
class openpyxl.cell.text.PhoneticProperties(fontId=None, type=None, alignment=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
alignment
Value must be one of {‘noControl’, ‘center’, ‘distributed’, ‘left’}
fontId
Values must be of type <class ‘int’>
type
Value must be one of {‘halfwidthKatakana’, ‘noConversion’, ‘fullwidthKatakana’, ‘Hiragana’}
class openpyxl.cell.text.PhoneticText(sb=None, eb=None, t=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
eb
Values must be of type <class ‘int’>

80 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

sb
Values must be of type <class ‘int’>
t
Values must be of type Values must be of type <class ‘str’>
class openpyxl.cell.text.RichText(rPr=None, t=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
rPr
Values must be of type <class ‘openpyxl.cell.text.InlineFont’>
t
Values must be of type <class ‘str’>
tagname = ‘RElt’
class openpyxl.cell.text.Text(t=None, r=(), rPh=(), phoneticPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
content
Text stripped of all formatting
phoneticPr
Values must be of type <class ‘openpyxl.cell.text.PhoneticProperties’>
r
A sequence (list or tuple) that may only contain objects of the declared type
rPh
A sequence (list or tuple) that may only contain objects of the declared type
t
Values must be of type <class ‘str’>
tagname = ‘text’

openpyxl.chart package

Submodules

openpyxl.chart.area_chart module
class openpyxl.chart.area_chart.AreaChart(axId=None, extLst=None, **kw)
Bases: openpyxl.chart.area_chart._AreaChartBase
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
dropLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
grouping
Value must be one of {‘stacked’, ‘standard’, ‘percentStacked’}
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘areaChart’

9.1. openpyxl package 81


openpyxl Documentation, Release 2.4.0

varyColors
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.TextAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
class openpyxl.chart.area_chart.AreaChart3D(gapDepth=None, **kw)
Bases: openpyxl.chart.area_chart.AreaChart
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
dropLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
gapDepth
Values must be of type <class ‘float’>
grouping
Value must be one of {‘stacked’, ‘standard’, ‘percentStacked’}
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘area3DChart’
varyColors
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.TextAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
z_axis
Values must be of type <class ‘openpyxl.chart.axis.SeriesAxis’>

openpyxl.chart.axis module
class openpyxl.chart.axis.ChartLines(spPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘chartLines’
class openpyxl.chart.axis.DateAxis(auto=None, lblOffset=None, baseTimeUnit=None, ma-
jorUnit=1, majorTimeUnit=None, minorUnit=None, minor-
TimeUnit=None, extLst=None, **kw)
Bases: openpyxl.chart.axis._BaseAxis
auto
Values must be of type <class ‘bool’>
axId
Values must be of type <class ‘int’>
axPos
Value must be one of {‘b’, ‘r’, ‘l’, ‘t’}

82 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

baseTimeUnit
Value must be one of {‘years’, ‘days’, ‘months’}
crossAx
Values must be of type <class ‘int’>
crosses
Value must be one of {‘max’, ‘min’, ‘autoZero’}
crossesAt
Values must be of type <class ‘float’>
delete
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
lblOffset
Values must be of type <class ‘int’>
majorGridlines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
majorTickMark
Value must be one of {‘in’, ‘out’, ‘cross’}
majorTimeUnit
Value must be one of {‘years’, ‘days’, ‘months’}
majorUnit
Values must be of type <class ‘float’>
minorGridlines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
minorTickMark
Value must be one of {‘in’, ‘out’, ‘cross’}
minorTimeUnit
Value must be one of {‘years’, ‘days’, ‘months’}
minorUnit
Values must be of type <class ‘float’>
numFmt
Values must be of type <class ‘openpyxl.chart.data_source.NumFmt’>
scaling
Values must be of type <class ‘openpyxl.chart.axis.Scaling’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘dateAx’
tickLblPos
Value must be one of {‘low’, ‘nextTo’, ‘high’}
title
Values must be of type <class ‘openpyxl.chart.title.Title’>
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>

9.1. openpyxl package 83


openpyxl Documentation, Release 2.4.0

class openpyxl.chart.axis.DisplayUnitsLabel(layout=None, tx=None, spPr=None,


txPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
layout
Values must be of type <class ‘openpyxl.chart.layout.Layout’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘dispUnitsLbl’
tx
Values must be of type <class ‘openpyxl.chart.text.Text’>
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>
class openpyxl.chart.axis.DisplayUnitsLabelList(custUnit=None, builtInUnit=None, dis-
pUnitsLbl=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
builtInUnit
Value must be one of {‘tenMillions’, ‘thousands’, ‘hundredMillions’, ‘trillions’, ‘hundreds’, ‘billions’,
‘hundredThousands’, ‘tenThousands’, ‘millions’}
custUnit
Values must be of type <class ‘float’>
dispUnitsLbl
Values must be of type <class ‘openpyxl.chart.axis.DisplayUnitsLabel’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
tagname = ‘dispUnits’
class openpyxl.chart.axis.NumericAxis(crossBetween=None, majorUnit=None, mi-
norUnit=None, dispUnits=None, extLst=None, **kw)
Bases: openpyxl.chart.axis._BaseAxis
axId
Values must be of type <class ‘int’>
axPos
Value must be one of {‘b’, ‘r’, ‘l’, ‘t’}
crossAx
Values must be of type <class ‘int’>
crossBetween
Value must be one of {‘midCat’, ‘between’}
crosses
Value must be one of {‘max’, ‘min’, ‘autoZero’}
crossesAt
Values must be of type <class ‘float’>
delete
Values must be of type <class ‘bool’>
dispUnits
Values must be of type <class ‘openpyxl.chart.axis.DisplayUnitsLabelList’>

84 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
majorGridlines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
majorTickMark
Value must be one of {‘in’, ‘out’, ‘cross’}
majorUnit
Values must be of type <class ‘float’>
minorGridlines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
minorTickMark
Value must be one of {‘in’, ‘out’, ‘cross’}
minorUnit
Values must be of type <class ‘float’>
numFmt
Values must be of type <class ‘openpyxl.chart.data_source.NumFmt’>
scaling
Values must be of type <class ‘openpyxl.chart.axis.Scaling’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘valAx’
tickLblPos
Value must be one of {‘low’, ‘nextTo’, ‘high’}
title
Values must be of type <class ‘openpyxl.chart.title.Title’>
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>
class openpyxl.chart.axis.Scaling(logBase=None, orientation=’minMax’, max=None, min=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
logBase
Values must be of type <class ‘float’>
max
Values must be of type <class ‘float’>
min
Values must be of type <class ‘float’>
orientation
Value must be one of {‘maxMin’, ‘minMax’}
tagname = ‘scaling’
class openpyxl.chart.axis.SeriesAxis(tickLblSkip=None, tickMarkSkip=None, extLst=None,
**kw)
Bases: openpyxl.chart.axis._BaseAxis

9.1. openpyxl package 85


openpyxl Documentation, Release 2.4.0

axId
Values must be of type <class ‘int’>
axPos
Value must be one of {‘b’, ‘r’, ‘l’, ‘t’}
crossAx
Values must be of type <class ‘int’>
crosses
Value must be one of {‘max’, ‘min’, ‘autoZero’}
crossesAt
Values must be of type <class ‘float’>
delete
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
majorGridlines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
majorTickMark
Value must be one of {‘in’, ‘out’, ‘cross’}
minorGridlines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
minorTickMark
Value must be one of {‘in’, ‘out’, ‘cross’}
numFmt
Values must be of type <class ‘openpyxl.chart.data_source.NumFmt’>
scaling
Values must be of type <class ‘openpyxl.chart.axis.Scaling’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘serAx’
tickLblPos
Value must be one of {‘low’, ‘nextTo’, ‘high’}
tickLblSkip
Values must be of type <class ‘int’>
tickMarkSkip
Values must be of type <class ‘int’>
title
Values must be of type <class ‘openpyxl.chart.title.Title’>
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>
class openpyxl.chart.axis.TextAxis(auto=None, lblAlgn=None, lblOffset=100, tickLblSkip=None,
tickMarkSkip=None, noMultiLvlLbl=None, extLst=None,
**kw)
Bases: openpyxl.chart.axis._BaseAxis

86 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

auto
Values must be of type <class ‘bool’>
axId
Values must be of type <class ‘int’>
axPos
Value must be one of {‘b’, ‘r’, ‘l’, ‘t’}
crossAx
Values must be of type <class ‘int’>
crosses
Value must be one of {‘max’, ‘min’, ‘autoZero’}
crossesAt
Values must be of type <class ‘float’>
delete
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
lblAlgn
Value must be one of {‘ctr’, ‘r’, ‘l’}
lblOffset
Values must be of type <class ‘float’>
majorGridlines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
majorTickMark
Value must be one of {‘in’, ‘out’, ‘cross’}
minorGridlines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
minorTickMark
Value must be one of {‘in’, ‘out’, ‘cross’}
noMultiLvlLbl
Values must be of type <class ‘bool’>
numFmt
Values must be of type <class ‘openpyxl.chart.data_source.NumFmt’>
scaling
Values must be of type <class ‘openpyxl.chart.axis.Scaling’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘catAx’
tickLblPos
Value must be one of {‘low’, ‘nextTo’, ‘high’}
tickLblSkip
Values must be of type <class ‘int’>
tickMarkSkip
Values must be of type <class ‘int’>

9.1. openpyxl package 87


openpyxl Documentation, Release 2.4.0

title
Values must be of type <class ‘openpyxl.chart.title.Title’>
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>

openpyxl.chart.bar_chart module
class openpyxl.chart.bar_chart.BarChart(gapWidth=150, overlap=None, serLines=None,
axId=None, extLst=None, **kw)
Bases: openpyxl.chart.bar_chart._BarChartBase
barDir
Value must be one of {‘col’, ‘bar’}
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
gapWidth
Values must be of type <class ‘float’>
grouping
Value must be one of {‘stacked’, ‘standard’, ‘clustered’, ‘percentStacked’}
overlap
Values must be of type <class ‘float’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
serLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
tagname = ‘barChart’
varyColors
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.TextAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
class openpyxl.chart.bar_chart.BarChart3D(gapWidth=150, gapDepth=150, shape=None, ser-
Lines=None, axId=None, extLst=None, **kw)
Bases: openpyxl.chart.bar_chart._BarChartBase, openpyxl.chart._3d._3DBase
backWall
Values must be of type <class ‘openpyxl.chart._3d.Surface’>
barDir
Value must be one of {‘col’, ‘bar’}
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
floor
Values must be of type <class ‘openpyxl.chart._3d.Surface’>

88 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

gapDepth
Values must be of type <class ‘float’>
gapWidth
Values must be of type <class ‘float’>
grouping
Value must be one of {‘stacked’, ‘standard’, ‘clustered’, ‘percentStacked’}
ser
A sequence (list or tuple) that may only contain objects of the declared type
serLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
shape
Value must be one of {‘coneToMax’, ‘pyramid’, ‘pyramidToMax’, ‘cylinder’, ‘box’, ‘cone’}
sideWall
Values must be of type <class ‘openpyxl.chart._3d.Surface’>
tagname = ‘bar3DChart’
varyColors
Values must be of type <class ‘bool’>
view3D
Values must be of type <class ‘openpyxl.chart._3d.View3D’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.TextAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
z_axis
Values must be of type <class ‘openpyxl.chart.axis.SeriesAxis’>

openpyxl.chart.bubble_chart module
class openpyxl.chart.bubble_chart.BubbleChart(varyColors=None, ser=(), dLbls=None, bub-
ble3D=None, bubbleScale=None, showNeg-
Bubbles=None, sizeRepresents=None,
axId=None, extLst=None)
Bases: openpyxl.chart._chart.ChartBase
bubble3D
Values must be of type <class ‘bool’>
bubbleScale
Values must be of type <class ‘float’>
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
showNegBubbles
Values must be of type <class ‘bool’>

9.1. openpyxl package 89


openpyxl Documentation, Release 2.4.0

sizeRepresents
Value must be one of {‘area’, ‘w’}
tagname = ‘bubbleChart’
varyColors
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>

openpyxl.chart.chartspace module
class openpyxl.chart.chartspace.ChartContainer(title=None, autoTitleDeleted=None,
pivotFmts=None, view3D=None,
floor=None, sideWall=None, back-
Wall=None, plotArea=None, legend=None,
plotVisOnly=None, dispBlanksAs=’gap’,
showDLblsOverMax=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
autoTitleDeleted
Values must be of type <class ‘bool’>
backWall
Values must be of type <class ‘openpyxl.chart._3d.Surface’>
dispBlanksAs
Value must be one of {‘zero’, ‘span’, ‘gap’}
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
floor
Values must be of type <class ‘openpyxl.chart._3d.Surface’>
legend
Values must be of type <class ‘openpyxl.chart.legend.Legend’>
pivotFmts
Values must be of type <class ‘openpyxl.chart.chartspace.PivotFormatList’>
plotArea
Values must be of type <class ‘openpyxl.chart.chartspace.PlotArea’>
plotVisOnly
Values must be of type <class ‘bool’>
showDLblsOverMax
Values must be of type <class ‘bool’>
sideWall
Values must be of type <class ‘openpyxl.chart._3d.Surface’>
tagname = ‘chart’
title
Values must be of type <class ‘openpyxl.chart.title.Title’>
view3D
Values must be of type <class ‘openpyxl.chart._3d.View3D’>

90 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.chart.chartspace.ChartSpace(date1904=None, lang=None, rounded-


Corners=None, style=None, clrMapOvr=None,
pivotSource=None, protection=None,
chart=None, spPr=None, txPr=None, exter-
nalData=None, printSettings=None, user-
Shapes=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
chart
Values must be of type <class ‘openpyxl.chart.chartspace.ChartContainer’>
clrMapOvr
Values must be of type <class ‘openpyxl.drawing.colors.ColorMapping’>
date1904
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
externalData
Values must be of type <class ‘openpyxl.chart.chartspace.ExternalData’>
lang
Values must be of type <class ‘str’>
pivotSource
Values must be of type <class ‘openpyxl.chart.chartspace.PivotSource’>
printSettings
Values must be of type <class ‘openpyxl.chart.chartspace.PrintSettings’>
protection
Values must be of type <class ‘openpyxl.chart.chartspace.Protection’>
roundedCorners
Values must be of type <class ‘bool’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
style
Values must be of type <class ‘int’>
tagname = ‘chartSpace’
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>
userShapes
Values must be of type <class ‘openpyxl.chart.chartspace.RelId’>
class openpyxl.chart.chartspace.DataTable(showHorzBorder=None, showVertBorder=None,
showOutline=None, showKeys=None, spPr=None,
txPr=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
showHorzBorder
Values must be of type <class ‘bool’>

9.1. openpyxl package 91


openpyxl Documentation, Release 2.4.0

showKeys
Values must be of type <class ‘bool’>
showOutline
Values must be of type <class ‘bool’>
showVertBorder
Values must be of type <class ‘bool’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘dTable’
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>
class openpyxl.chart.chartspace.ExternalData(autoUpdate=None, id=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
autoUpdate
Values must be of type <class ‘bool’>
id
Values must be of type <class ‘str’>
tagname = ‘externalData’
class openpyxl.chart.chartspace.PivotFormat(idx=0, spPr=None, txPr=None, marker=None,
dLbl=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
dLbl
Values must be of type <class ‘openpyxl.chart.label.DataLabel’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
idx
Values must be of type <class ‘int’>
marker
Values must be of type <class ‘openpyxl.chart.marker.Marker’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘pivotFmt’
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>
class openpyxl.chart.chartspace.PivotFormatList(pivotFmt=())
Bases: openpyxl.descriptors.serialisable.Serialisable
pivotFmt
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘pivotFmts’
class openpyxl.chart.chartspace.PivotSource(name=None, fmtId=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>

92 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

fmtId
Values must be of type <class ‘int’>
name
Values must be of type <class ‘str’>
tagname = ‘pivotSource’
class openpyxl.chart.chartspace.PlotArea(layout=None, dTable=None, spPr=None,
areaChart=None, area3DChart=None,
lineChart=None, line3DChart=None,
stockChart=None, radarChart=None, scatter-
Chart=None, pieChart=None, pie3DChart=None,
doughnutChart=None, barChart=None,
bar3DChart=None, ofPieChart=None, sur-
faceChart=None, surface3DChart=None, bub-
bleChart=None, valAx=(), catAx=(), serAx=(),
dateAx=(), extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
area3DChart
Values must be of type <class ‘openpyxl.chart.area_chart.AreaChart3D’>
areaChart
Values must be of type <class ‘openpyxl.chart.area_chart.AreaChart’>
bar3DChart
Values must be of type <class ‘openpyxl.chart.bar_chart.BarChart3D’>
barChart
Values must be of type <class ‘openpyxl.chart.bar_chart.BarChart’>
bubbleChart
Values must be of type <class ‘openpyxl.chart.bubble_chart.BubbleChart’>
catAx
A sequence (list or tuple) that may only contain objects of the declared type
dTable
Values must be of type <class ‘openpyxl.chart.chartspace.DataTable’>
dateAx
A sequence (list or tuple) that may only contain objects of the declared type
doughnutChart
Values must be of type <class ‘openpyxl.chart.pie_chart.DoughnutChart’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
layout
Values must be of type <class ‘openpyxl.chart.layout.Layout’>
line3DChart
Values must be of type <class ‘openpyxl.chart.line_chart.LineChart3D’>
lineChart
Values must be of type <class ‘openpyxl.chart.line_chart.LineChart’>
ofPieChart
Values must be of type <class ‘openpyxl.chart.pie_chart.ProjectedPieChart’>

9.1. openpyxl package 93


openpyxl Documentation, Release 2.4.0

pie3DChart
Values must be of type <class ‘openpyxl.chart.pie_chart.PieChart3D’>
pieChart
Values must be of type <class ‘openpyxl.chart.pie_chart.PieChart’>
radarChart
Values must be of type <class ‘openpyxl.chart.radar_chart.RadarChart’>
scatterChart
Values must be of type <class ‘openpyxl.chart.scatter_chart.ScatterChart’>
serAx
A sequence (list or tuple) that may only contain objects of the declared type
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
stockChart
Values must be of type <class ‘openpyxl.chart.stock_chart.StockChart’>
surface3DChart
Values must be of type <class ‘openpyxl.chart.surface_chart.SurfaceChart3D’>
surfaceChart
Values must be of type <class ‘openpyxl.chart.surface_chart.SurfaceChart’>
tagname = ‘plotArea’
to_tree(tagname=None, idx=None)
valAx
A sequence (list or tuple) that may only contain objects of the declared type
class openpyxl.chart.chartspace.PrintSettings(headerFooter=None, pageMargins=None,
pageSetup=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
headerFooter
Values must be of type <class ‘openpyxl.worksheet.header_footer.HeaderFooter’>
pageMargins
Values must be of type <class ‘openpyxl.worksheet.page.PageMargins’>
pageSetup
Values must be of type <class ‘openpyxl.worksheet.page.PrintPageSetup’>
tagname = ‘printSettings’
class openpyxl.chart.chartspace.Protection(chartObject=None, data=None, format-
ting=None, selection=None, userInter-
face=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
chartObject
Values must be of type <class ‘bool’>
data
Values must be of type <class ‘bool’>
formatting
Values must be of type <class ‘bool’>
selection
Values must be of type <class ‘bool’>

94 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

tagname = ‘protection’
userInterface
Values must be of type <class ‘bool’>
class openpyxl.chart.chartspace.RelId
Bases: openpyxl.descriptors.serialisable.Serialisable

openpyxl.chart.data_source module Collection of utility primitives for charts.


class openpyxl.chart.data_source.AxDataSource(numRef=None, numLit=None, strRef=None,
strLit=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
numLit
Values must be of type <class ‘openpyxl.chart.data_source.NumData’>
numRef
Values must be of type <class ‘openpyxl.chart.data_source.NumRef’>
strLit
Values must be of type <class ‘openpyxl.chart.data_source.StrData’>
strRef
Values must be of type <class ‘openpyxl.chart.data_source.StrRef’>
class openpyxl.chart.data_source.NumData(formatCode=None, ptCount=None, pt=(),
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
formatCode
Values must be of type <class ‘str’>
pt
A sequence (list or tuple) that may only contain objects of the declared type
ptCount
Values must be of type <class ‘int’>
class openpyxl.chart.data_source.NumDataSource(numRef=None, numLit=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
numLit
Values must be of type <class ‘openpyxl.chart.data_source.NumData’>
numRef
Values must be of type <class ‘openpyxl.chart.data_source.NumRef’>
class openpyxl.chart.data_source.NumFmt(formatCode=None, sourceLinked=False)
Bases: openpyxl.descriptors.serialisable.Serialisable
formatCode
Values must be of type <class ‘str’>
sourceLinked
Values must be of type <class ‘bool’>
class openpyxl.chart.data_source.NumRef(f=None, numCache=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable

9.1. openpyxl package 95


openpyxl Documentation, Release 2.4.0

extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
f
Values must be of type <class ‘str’>
numCache
Values must be of type <class ‘openpyxl.chart.data_source.NumData’>
class openpyxl.chart.data_source.NumVal(idx=None, formatCode=None, v=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
formatCode
Values must be of type <class ‘str’>
idx
Values must be of type <class ‘int’>
v
Values must be of type <class ‘float’>
class openpyxl.chart.data_source.StrData(ptCount=None, pt=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
pt
Values must be of type <class ‘openpyxl.chart.data_source.StrVal’>
ptCount
Values must be of type <class ‘int’>
tagname = ‘strData’
class openpyxl.chart.data_source.StrRef(f=None, strCache=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
f
Values must be of type <class ‘str’>
strCache
Values must be of type <class ‘openpyxl.chart.data_source.StrData’>
tagname = ‘strRef’
class openpyxl.chart.data_source.StrVal(idx=0, v=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
idx
Values must be of type <class ‘int’>
tagname = ‘strVal’
v
Values must be of type <class ‘str’>

openpyxl.chart.descriptors module
class openpyxl.chart.descriptors.NestedGapAmount(**kw)
Bases: openpyxl.descriptors.nested.NestedMinMax

96 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

allow_none = True
max = 500
min = 0
class openpyxl.chart.descriptors.NestedOverlap(**kw)
Bases: openpyxl.descriptors.nested.NestedMinMax
allow_none = True
max = 100
min = -100
class openpyxl.chart.descriptors.NumberFormatDescriptor(*args, **kw)
Bases: openpyxl.descriptors.base.Typed
Allow direct assignment of format code
allow_none = True
expected_type
alias of NumFmt

openpyxl.chart.error_bar module
class openpyxl.chart.error_bar.ErrorBars(errDir=None, errBarType=’both’, errVal-
Type=’fixedVal’, noEndCap=None, plus=None,
minus=None, val=None, spPr=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
errBarType
Value must be one of {‘plus’, ‘both’, ‘minus’}
errDir
Value must be one of {‘y’, ‘x’}
errValType
Value must be one of {‘percentage’, ‘cust’, ‘fixedVal’, ‘stdDev’, ‘stdErr’}
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
minus
Values must be of type <class ‘openpyxl.chart.data_source.NumDataSource’>
noEndCap
Values must be of type <class ‘bool’>
plus
Values must be of type <class ‘openpyxl.chart.data_source.NumDataSource’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘errBars’
val
Values must be of type <class ‘float’>

openpyxl.chart.label module
class openpyxl.chart.label.DataLabel(idx=0, **kw)
Bases: openpyxl.chart.label._DataLabelBase

9.1. openpyxl package 97


openpyxl Documentation, Release 2.4.0

dLblPos
Value must be one of {‘bestFit’, ‘inEnd’, ‘r’, ‘ctr’, ‘l’, ‘b’, ‘inBase’, ‘outEnd’, ‘t’}
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
idx
Values must be of type <class ‘int’>
numFmt
Values must be of type <class ‘str’>
separator
Values must be of type <class ‘str’>
showBubbleSize
Values must be of type <class ‘bool’>
showCatName
Values must be of type <class ‘bool’>
showLeaderLines
Values must be of type <class ‘bool’>
showLegendKey
Values must be of type <class ‘bool’>
showPercent
Values must be of type <class ‘bool’>
showSerName
Values must be of type <class ‘bool’>
showVal
Values must be of type <class ‘bool’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘dLbl’
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>
class openpyxl.chart.label.DataLabelList(dLbl=(), **kw)
Bases: openpyxl.chart.label._DataLabelBase
dLbl
A sequence (list or tuple) that may only contain objects of the declared type
dLblPos
Value must be one of {‘bestFit’, ‘inEnd’, ‘r’, ‘ctr’, ‘l’, ‘b’, ‘inBase’, ‘outEnd’, ‘t’}
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
numFmt
Values must be of type <class ‘str’>
separator
Values must be of type <class ‘str’>
showBubbleSize
Values must be of type <class ‘bool’>

98 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

showCatName
Values must be of type <class ‘bool’>
showLeaderLines
Values must be of type <class ‘bool’>
showLegendKey
Values must be of type <class ‘bool’>
showPercent
Values must be of type <class ‘bool’>
showSerName
Values must be of type <class ‘bool’>
showVal
Values must be of type <class ‘bool’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘dLbls’
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>

openpyxl.chart.layout module
class openpyxl.chart.layout.Layout(manualLayout=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
manualLayout
Values must be of type <class ‘openpyxl.chart.layout.ManualLayout’>
tagname = ‘layout’
class openpyxl.chart.layout.ManualLayout(layoutTarget=None, xMode=None, yMode=None,
wMode=None, hMode=None, x=None, y=None,
w=None, h=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
h
Values must be of type <class ‘float’>
hMode
Value must be one of {‘edge’, ‘factor’}
layoutTarget
Value must be one of {‘inner’, ‘outer’}
tagname = ‘manualLayout’
w
Values must be of type <class ‘float’>
wMode
Value must be one of {‘edge’, ‘factor’}

9.1. openpyxl package 99


openpyxl Documentation, Release 2.4.0

x
Values must be of type <class ‘float’>
xMode
Value must be one of {‘edge’, ‘factor’}
y
Values must be of type <class ‘float’>
yMode
Value must be one of {‘edge’, ‘factor’}

openpyxl.chart.legend module
class openpyxl.chart.legend.Legend(legendPos=’r’, legendEntry=None, layout=None, over-
lay=None, spPr=None, txPr=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
layout
Values must be of type <class ‘openpyxl.chart.layout.Layout’>
legendEntry
Values must be of type <class ‘openpyxl.chart.legend.LegendEntry’>
legendPos
Value must be one of {‘b’, ‘r’, ‘l’, ‘tr’, ‘t’}
overlay
Values must be of type <class ‘bool’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘legend’
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>
class openpyxl.chart.legend.LegendEntry(idx=0, delete=False, txPr=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
delete
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
idx
Values must be of type <class ‘int’>
tagname = ‘legendEntry’
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>

openpyxl.chart.line_chart module
class openpyxl.chart.line_chart.LineChart(hiLowLines=None, upDownBars=None,
marker=None, smooth=None, axId=None,
extLst=None, **kw)
Bases: openpyxl.chart.line_chart._LineChartBase

100 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
dropLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
grouping
Value must be one of {‘stacked’, ‘standard’, ‘percentStacked’}
hiLowLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
marker
Values must be of type <class ‘bool’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
smooth
Values must be of type <class ‘bool’>
tagname = ‘lineChart’
upDownBars
Values must be of type <class ‘openpyxl.chart.updown_bars.UpDownBars’>
varyColors
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis._BaseAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
class openpyxl.chart.line_chart.LineChart3D(gapDepth=None, hiLowLines=None, upDown-
Bars=None, marker=None, smooth=None,
axId=None, **kw)
Bases: openpyxl.chart.line_chart._LineChartBase
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
dropLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
gapDepth
Values must be of type <class ‘float’>
grouping
Value must be one of {‘stacked’, ‘standard’, ‘percentStacked’}
hiLowLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
marker
Values must be of type <class ‘bool’>

9.1. openpyxl package 101


openpyxl Documentation, Release 2.4.0

ser
A sequence (list or tuple) that may only contain objects of the declared type
smooth
Values must be of type <class ‘bool’>
tagname = ‘line3DChart’
upDownBars
Values must be of type <class ‘openpyxl.chart.updown_bars.UpDownBars’>
varyColors
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.TextAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
z_axis
Values must be of type <class ‘openpyxl.chart.axis.SeriesAxis’>

openpyxl.chart.marker module
class openpyxl.chart.marker.DataPoint(idx=None, invertIfNegative=None, marker=None, bub-
ble3D=None, explosion=None, spPr=None, pictureOp-
tions=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
bubble3D
Values must be of type <class ‘bool’>
explosion
Values must be of type <class ‘int’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
idx
Values must be of type <class ‘int’>
invertIfNegative
Values must be of type <class ‘bool’>
marker
Values must be of type <class ‘openpyxl.chart.marker.Marker’>
pictureOptions
Values must be of type <class ‘openpyxl.chart.picture.PictureOptions’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘dPt’
class openpyxl.chart.marker.Marker(symbol=None, size=None, spPr=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
size
Values must be of type <class ‘float’>

102 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
symbol
Value must be one of {‘star’, ‘square’, ‘diamond’, ‘auto’, ‘triangle’, ‘picture’, ‘plus’, ‘circle’, ‘dash’, ‘dot’,
‘x’}
tagname = ‘marker’

openpyxl.chart.picture module
class openpyxl.chart.picture.PictureOptions(applyToFront=None, applyToSides=None,
applyToEnd=None, pictureFormat=None,
pictureStackUnit=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
applyToEnd
Values must be of type <class ‘bool’>
applyToFront
Values must be of type <class ‘bool’>
applyToSides
Values must be of type <class ‘bool’>
pictureFormat
Value must be one of {‘stretch’, ‘stack’, ‘stackScale’}
pictureStackUnit
Values must be of type <class ‘float’>
tagname = ‘pictureOptions’

openpyxl.chart.pie_chart module
class openpyxl.chart.pie_chart.CustomSplit(secondPiePt=())
Bases: openpyxl.descriptors.serialisable.Serialisable
secondPiePt
A sequence of primitive types that are stored as a single attribute. “val” is the default attribute
tagname = ‘custSplit’
class openpyxl.chart.pie_chart.DoughnutChart(firstSliceAng=0, holeSize=10, extLst=None,
**kw)
Bases: openpyxl.chart.pie_chart._PieChartBase
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
firstSliceAng
Values must be of type <class ‘float’>
holeSize
Values must be of type <class ‘float’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘doughnutChart’

9.1. openpyxl package 103


openpyxl Documentation, Release 2.4.0

varyColors
Values must be of type <class ‘bool’>
class openpyxl.chart.pie_chart.PieChart(firstSliceAng=0, extLst=None, **kw)
Bases: openpyxl.chart.pie_chart._PieChartBase
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
firstSliceAng
Values must be of type <class ‘float’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘pieChart’
varyColors
Values must be of type <class ‘bool’>
class openpyxl.chart.pie_chart.PieChart3D(varyColors=True, ser=(), dLbls=None)
Bases: openpyxl.chart.pie_chart._PieChartBase
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘pie3DChart’
varyColors
Values must be of type <class ‘bool’>
class openpyxl.chart.pie_chart.ProjectedPieChart(ofPieType=’pie’, gapWidth=None,
splitType=’auto’, splitPos=None,
custSplit=None, secondPieSize=75,
serLines=None, extLst=None, **kw)
Bases: openpyxl.chart.pie_chart._PieChartBase
From the spec 21.2.2.126
This element contains the pie of pie or bar of pie series on this chart. Only the first series shall be displayed.
The splitType element shall determine whether the splitPos and custSplit elements apply.
custSplit
Values must be of type <class ‘openpyxl.chart.pie_chart.CustomSplit’>
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
gapWidth
Values must be of type <class ‘float’>
ofPieType
Value must be one of {‘bar’, ‘pie’}

104 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

secondPieSize
Values must be of type <class ‘float’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
serLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
splitPos
Values must be of type <class ‘float’>
splitType
Value must be one of {‘auto’, ‘pos’, ‘cust’, ‘percent’, ‘val’}
tagname = ‘ofPieChart’
varyColors
Values must be of type <class ‘bool’>

openpyxl.chart.radar_chart module
class openpyxl.chart.radar_chart.RadarChart(radarStyle=’standard’, varyColors=None,
ser=(), dLbls=None, axId=None, extLst=None)
Bases: openpyxl.chart._chart.ChartBase
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
radarStyle
Value must be one of {‘filled’, ‘standard’, ‘marker’}
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘radarChart’
varyColors
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.TextAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>

openpyxl.chart.reference module
class openpyxl.chart.reference.DummyWorksheet(title)
Bases: object
class openpyxl.chart.reference.Reference(worksheet=None, min_col=None,
min_row=None, max_col=None, max_row=None,
range_string=None)
Bases: openpyxl.descriptors.Strict
Normalise cell range references
cells
Return a flattened list of all cells (by column)

9.1. openpyxl package 105


openpyxl Documentation, Release 2.4.0

cols
Return all cells in range by row
max_col
Values must be of type <class ‘int’>
max_row
Values must be of type <class ‘int’>
min_col
Values must be of type <class ‘int’>
min_row
Values must be of type <class ‘int’>
pop()
Return and remove the first cell
range_string
Values must be of type <class ‘str’>
rows
Return all cells in range by column
sheetname

openpyxl.chart.scatter_chart module
class openpyxl.chart.scatter_chart.ScatterChart(scatterStyle=None, varyColors=None,
ser=(), dLbls=None, axId=None,
extLst=None)
Bases: openpyxl.chart._chart.ChartBase
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
scatterStyle
Value must be one of {‘lineMarker’, ‘smooth’, ‘smoothMarker’, ‘line’, ‘marker’}
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘scatterChart’
varyColors
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>

openpyxl.chart.series module

106 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.chart.series.Series(idx=0, order=0, tx=None, spPr=None, pictureOptions=None,


dPt=(), dLbls=None, trendline=None, errBars=None,
cat=None, val=None, invertIfNegative=None, shape=None,
xVal=None, yVal=None, bubbleSize=None, bubble3D=None,
marker=None, smooth=None, explosion=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
Generic series object. Should not be instantiated directly. User the chart.Series factory instead.
bubble3D
Values must be of type <class ‘bool’>
bubbleSize
Values must be of type <class ‘openpyxl.chart.data_source.NumDataSource’>
cat
Values must be of type <class ‘openpyxl.chart.data_source.AxDataSource’>
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
dPt
A sequence (list or tuple) that may only contain objects of the declared type
errBars
Values must be of type <class ‘openpyxl.chart.error_bar.ErrorBars’>
explosion
Values must be of type <class ‘int’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
idx
Values must be of type <class ‘int’>
invertIfNegative
Values must be of type <class ‘bool’>
marker
Values must be of type <class ‘openpyxl.chart.marker.Marker’>
order
Values must be of type <class ‘int’>
pictureOptions
Values must be of type <class ‘openpyxl.chart.picture.PictureOptions’>
shape
Value must be one of {‘coneToMax’, ‘pyramid’, ‘pyramidToMax’, ‘cylinder’, ‘box’, ‘cone’}
smooth
Values must be of type <class ‘bool’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘ser’
to_tree(tagname=None, idx=None)
trendline
Values must be of type <class ‘openpyxl.chart.trendline.Trendline’>

9.1. openpyxl package 107


openpyxl Documentation, Release 2.4.0

tx
Values must be of type <class ‘openpyxl.chart.series.SeriesLabel’>
val
Values must be of type <class ‘openpyxl.chart.data_source.NumDataSource’>
xVal
Values must be of type <class ‘openpyxl.chart.data_source.AxDataSource’>
yVal
Values must be of type <class ‘openpyxl.chart.data_source.NumDataSource’>
class openpyxl.chart.series.SeriesLabel(strRef=None, v=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
strRef
Values must be of type <class ‘openpyxl.chart.data_source.StrRef’>
tagname = ‘tx’
v
Values must be of type <class ‘str’>
class openpyxl.chart.series.XYSeries(idx=0, order=0, tx=None, spPr=None, pictureOp-
tions=None, dPt=(), dLbls=None, trendline=None,
errBars=None, cat=None, val=None, invertIfNeg-
ative=None, shape=None, xVal=None, yVal=None,
bubbleSize=None, bubble3D=None, marker=None,
smooth=None, explosion=None)
Bases: openpyxl.chart.series.Series
Dedicated series for charts that have x and y series
bubble3D
Values must be of type <class ‘bool’>
bubbleSize
Values must be of type <class ‘openpyxl.chart.data_source.NumDataSource’>
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
dPt
A sequence (list or tuple) that may only contain objects of the declared type
errBars
Values must be of type <class ‘openpyxl.chart.error_bar.ErrorBars’>
idx
Values must be of type <class ‘int’>
invertIfNegative
Values must be of type <class ‘bool’>
marker
Values must be of type <class ‘openpyxl.chart.marker.Marker’>
order
Values must be of type <class ‘int’>
smooth
Values must be of type <class ‘bool’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>

108 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

trendline
Values must be of type <class ‘openpyxl.chart.trendline.Trendline’>
tx
Values must be of type <class ‘openpyxl.chart.series.SeriesLabel’>
xVal
Values must be of type <class ‘openpyxl.chart.data_source.AxDataSource’>
yVal
Values must be of type <class ‘openpyxl.chart.data_source.NumDataSource’>

openpyxl.chart.series_factory module
openpyxl.chart.series_factory.SeriesFactory(values, xvalues=None, zvalues=None, ti-
tle=None, title_from_data=False)
Convenience Factory for creating chart data series.

openpyxl.chart.shapes module
class openpyxl.chart.shapes.GraphicalProperties(bwMode=None, xfrm=None,
noFill=None, solidFill=None, grad-
Fill=None, pattFill=None, ln=None,
scene3d=None, custGeom=None, prst-
Geom=None, sp3d=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
Somewhat vaguely 21.2.2.197 says this:
This element specifies the formatting for the parent chart element. The custGeom, prstGeom, scene3d, and xfrm
elements are not supported. The bwMode attribute is not supported.
This doesn’t leave much. And the element is used in different places.
bwMode
Value must be one of {‘gray’, ‘blackWhite’, ‘hidden’, ‘auto’, ‘grayWhite’, ‘ltGray’, ‘white’, ‘clr’, ‘in-
vGray’, ‘blackGray’, ‘black’}
custGeom
Values must be of type <class ‘openpyxl.drawing.shapes.CustomGeometry2D’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
gradFill
Values must be of type <class ‘openpyxl.drawing.fill.GradientFillProperties’>
ln
Values must be of type <class ‘openpyxl.drawing.line.LineProperties’>
noFill
Values must be of type <class ‘bool’>
pattFill
Values must be of type <class ‘openpyxl.drawing.fill.PatternFillProperties’>
prstGeom
Values must be of type <class ‘openpyxl.drawing.shapes.PresetGeometry2D’>
scene3d
Values must be of type <class ‘openpyxl.drawing.shapes.Scene3D’>

9.1. openpyxl package 109


openpyxl Documentation, Release 2.4.0

solidFill
Values must be of type <class ‘openpyxl.drawing.colors.ColorChoice’>
sp3d
Values must be of type <class ‘openpyxl.drawing.shapes.Shape3D’>
tagname = ‘spPr’
xfrm
Values must be of type <class ‘openpyxl.drawing.shapes.Transform2D’>

openpyxl.chart.stock_chart module
class openpyxl.chart.stock_chart.StockChart(ser=(), dLbls=None, dropLines=None, hiLow-
Lines=None, upDownBars=None, axId=None,
extLst=None)
Bases: openpyxl.chart._chart.ChartBase
dLbls
Values must be of type <class ‘openpyxl.chart.label.DataLabelList’>
dropLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
hiLowLines
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘stockChart’
upDownBars
Values must be of type <class ‘openpyxl.chart.updown_bars.UpDownBars’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.TextAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>

openpyxl.chart.surface_chart module
class openpyxl.chart.surface_chart.BandFormat(idx=0, spPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
idx
Values must be of type <class ‘int’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘bandFmt’
class openpyxl.chart.surface_chart.BandFormatList(bandFmt=())
Bases: openpyxl.descriptors.serialisable.Serialisable
bandFmt
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘bandFmts’

110 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.chart.surface_chart.SurfaceChart(**kw)
Bases: openpyxl.chart.surface_chart.SurfaceChart3D
bandFmts
Values must be of type <class ‘openpyxl.chart.surface_chart.BandFormatList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘surfaceChart’
wireframe
Values must be of type <class ‘bool’>
class openpyxl.chart.surface_chart.SurfaceChart3D(axId=None, **kw)
Bases: openpyxl.chart.surface_chart._SurfaceChartBase,
openpyxl.chart._3d._3DBase
bandFmts
Values must be of type <class ‘openpyxl.chart.surface_chart.BandFormatList’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
ser
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘surface3DChart’
wireframe
Values must be of type <class ‘bool’>
x_axis
Values must be of type <class ‘openpyxl.chart.axis.TextAxis’>
y_axis
Values must be of type <class ‘openpyxl.chart.axis.NumericAxis’>
z_axis
Values must be of type <class ‘openpyxl.chart.axis.SeriesAxis’>

openpyxl.chart.text module
class openpyxl.chart.text.RichText(bodyPr=None, lstStyle=None, p=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
From the specification: 21.2.2.216
This element specifies text formatting. The lstStyle element is not supported.
bodyPr
Values must be of type <class ‘openpyxl.drawing.text.RichTextProperties’>
lstStyle
Values must be of type <class ‘openpyxl.drawing.text.ListStyle’>
p
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘rich’

9.1. openpyxl package 111


openpyxl Documentation, Release 2.4.0

class openpyxl.chart.text.Text(strRef=None, rich=None)


Bases: openpyxl.descriptors.serialisable.Serialisable
rich
Values must be of type <class ‘openpyxl.chart.text.RichText’>
strRef
Values must be of type <class ‘openpyxl.chart.data_source.StrRef’>

openpyxl.chart.title module
class openpyxl.chart.title.Title(tx=None, layout=None, overlay=None, spPr=None, txPr=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
layout
Values must be of type <class ‘openpyxl.chart.layout.Layout’>
overlay
Values must be of type <class ‘bool’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘title’
tx
Values must be of type <class ‘openpyxl.chart.text.Text’>
txPr
Values must be of type <class ‘openpyxl.drawing.text.RichTextProperties’>
class openpyxl.chart.title.TitleDescriptor(*args, **kw)
Bases: openpyxl.descriptors.base.Typed
allow_none = True
expected_type
alias of Title
openpyxl.chart.title.title_maker(text)

openpyxl.chart.trendline module
class openpyxl.chart.trendline.Trendline(name=None, spPr=None, trendlineType=’linear’,
order=None, period=None, forward=None, back-
ward=None, intercept=None, dispRSqr=None, dis-
pEq=None, trendlineLbl=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
backward
Values must be of type <class ‘float’>
dispEq
Values must be of type <class ‘bool’>
dispRSqr
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>

112 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

forward
Values must be of type <class ‘float’>
intercept
Values must be of type <class ‘float’>
name
Values must be of type <class ‘str’>
order
Values must be of type <class ‘int’>
period
Values must be of type <class ‘int’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘trendline’
trendlineLbl
Values must be of type <class ‘openpyxl.chart.trendline.TrendlineLabel’>
trendlineType
Value must be one of {‘linear’, ‘power’, ‘poly’, ‘movingAvg’, ‘exp’, ‘log’}
class openpyxl.chart.trendline.TrendlineLabel(layout=None, tx=None, numFmt=None,
spPr=None, txPr=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
layout
Values must be of type <class ‘openpyxl.chart.layout.Layout’>
numFmt
Values must be of type <class ‘openpyxl.chart.data_source.NumFmt’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
tagname = ‘trendlineLbl’
tx
Values must be of type <class ‘openpyxl.chart.text.Text’>
txPr
Values must be of type <class ‘openpyxl.chart.text.RichText’>

openpyxl.chart.updown_bars module
class openpyxl.chart.updown_bars.UpDownBars(gapWidth=150, upBars=None, down-
Bars=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
downBars
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
gapWidth
Values must be of type <class ‘float’>

9.1. openpyxl package 113


openpyxl Documentation, Release 2.4.0

tagname = ‘upbars’
upBars
Values must be of type <class ‘openpyxl.chart.axis.ChartLines’>

openpyxl.chartsheet package

Subpackages

openpyxl.chartsheet.tests package

Submodules

openpyxl.chartsheet.tests.test_chartsheet module
openpyxl.chartsheet.tests.test_chartsheet.Chartsheet()
class openpyxl.chartsheet.tests.test_chartsheet.DummyWorkbook
Bases: object
class openpyxl.chartsheet.tests.test_chartsheet.TestChartsheet
Bases: object
test_ctor(Chartsheet)
test_read(Chartsheet)
test_write(Chartsheet)
test_write_charts(Chartsheet)

openpyxl.chartsheet.tests.test_custom module
openpyxl.chartsheet.tests.test_custom.CustomChartsheetView()
openpyxl.chartsheet.tests.test_custom.CustomChartsheetViews()
class openpyxl.chartsheet.tests.test_custom.TestCustomChartsheetView
Bases: object
test_read(CustomChartsheetView)
test_write(CustomChartsheetView)
class openpyxl.chartsheet.tests.test_custom.TestCustomChartsheetViews
Bases: object
test_read(CustomChartsheetViews)
test_write(CustomChartsheetViews)

openpyxl.chartsheet.tests.test_properties module
openpyxl.chartsheet.tests.test_properties.ChartsheetProperties()
class openpyxl.chartsheet.tests.test_properties.TestChartsheetPr
Bases: object
test_read(ChartsheetProperties)
test_write(ChartsheetProperties)

114 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.chartsheet.tests.test_protection module
openpyxl.chartsheet.tests.test_protection.ChartsheetProtection()
class openpyxl.chartsheet.tests.test_protection.TestChartsheetProtection
Bases: object
test_read(ChartsheetProtection)
test_write(ChartsheetProtection)

openpyxl.chartsheet.tests.test_publish module
class openpyxl.chartsheet.tests.test_publish.TestWebPublishItems
Bases: object
test_read(WebPublishItems)
test_write(WebPublishItems)
class openpyxl.chartsheet.tests.test_publish.TestWebPulishItem
Bases: object
test_read(WebPublishItem)
test_write(WebPublishItem)
openpyxl.chartsheet.tests.test_publish.WebPublishItem()
openpyxl.chartsheet.tests.test_publish.WebPublishItems()

openpyxl.chartsheet.tests.test_relation module
openpyxl.chartsheet.tests.test_relation.DrawingHF()
openpyxl.chartsheet.tests.test_relation.SheetBackgroundPicture()
class openpyxl.chartsheet.tests.test_relation.TestDrawingHF
Bases: object
test_read(DrawingHF)
test_write(DrawingHF)
class openpyxl.chartsheet.tests.test_relation.TestSheetBackgroundPicture
Bases: object
test_read(SheetBackgroundPicture)
test_write(SheetBackgroundPicture)

openpyxl.chartsheet.tests.test_views module
openpyxl.chartsheet.tests.test_views.ChartsheetView()
openpyxl.chartsheet.tests.test_views.ChartsheetViewList()
class openpyxl.chartsheet.tests.test_views.TestChartsheetView
Bases: object
test_read(ChartsheetView)
test_write(ChartsheetView)
class openpyxl.chartsheet.tests.test_views.TestChartsheetViewList
Bases: object
test_read(ChartsheetViewList)
test_write(ChartsheetViewList)

9.1. openpyxl package 115


openpyxl Documentation, Release 2.4.0

Submodules

openpyxl.chartsheet.chartsheet module
class openpyxl.chartsheet.chartsheet.Chartsheet(sheetPr=None, sheetViews=None,
sheetProtection=None, cus-
tomSheetViews=None, pageMar-
gins=None, pageSetup=None, head-
erFooter=None, drawing=None, draw-
ingHF=None, picture=None, webPub-
lishItems=None, extLst=None, par-
ent=None, title=’‘, sheet_state=’visible’)
Bases: openpyxl.workbook.child._WorkbookChild, openpyxl.descriptors.serialisable.Serialisa

add_chart(chart)
customSheetViews
Values must be of type <class ‘openpyxl.chartsheet.custom.CustomChartsheetViews’>
drawing
Values must be of type <class ‘openpyxl.worksheet.drawing.Drawing’>
drawingHF
Values must be of type <class ‘openpyxl.chartsheet.relation.DrawingHF’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
headerFooter
Values must be of type <class ‘openpyxl.worksheet.header_footer.HeaderFooter’>
pageMargins
Values must be of type <class ‘openpyxl.worksheet.page.PageMargins’>
pageSetup
Values must be of type <class ‘openpyxl.worksheet.page.PrintPageSetup’>
picture
Values must be of type <class ‘openpyxl.chartsheet.relation.SheetBackgroundPicture’>
sheetPr
Values must be of type <class ‘openpyxl.chartsheet.properties.ChartsheetProperties’>
sheetProtection
Values must be of type <class ‘openpyxl.chartsheet.protection.ChartsheetProtection’>
sheetViews
Values must be of type <class ‘openpyxl.chartsheet.views.ChartsheetViewList’>
sheet_state
Value must be one of {‘visible’, ‘veryHidden’, ‘hidden’}
tagname = ‘chartsheet’
to_tree()
webPublishItems
Values must be of type <class ‘openpyxl.chartsheet.publish.WebPublishItems’>

openpyxl.chartsheet.custom module

116 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.chartsheet.custom.CustomChartsheetView(guid=None, scale=None,


state=’visible’,
zoomToFit=None, pageMar-
gins=None, pageSetup=None,
headerFooter=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
guid
headerFooter
Values must be of type <class ‘openpyxl.worksheet.header_footer.HeaderFooter’>
pageMargins
Values must be of type <class ‘openpyxl.worksheet.page.PageMargins’>
pageSetup
Values must be of type <class ‘openpyxl.worksheet.page.PrintPageSetup’>
scale
Values must be of type <class ‘int’>
state
Value must be one of {‘visible’, ‘veryHidden’, ‘hidden’}
tagname = ‘customSheetView’
zoomToFit
Values must be of type <class ‘bool’>
class openpyxl.chartsheet.custom.CustomChartsheetViews(customSheetView=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
customSheetView
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘customSheetViews’

openpyxl.chartsheet.properties module
class openpyxl.chartsheet.properties.ChartsheetProperties(published=None, co-
deName=None, tab-
Color=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
codeName
Values must be of type <class ‘str’>
published
Values must be of type <class ‘bool’>
tabColor
Values must be of type <class ‘openpyxl.styles.colors.Color’>
tagname = ‘sheetPr’

openpyxl.chartsheet.protection module
class openpyxl.chartsheet.protection.ChartsheetProtection(content=None, ob-
jects=None, hash-
Value=None, spin-
Count=None, salt-
Value=None, algo-
rithmName=None, pass-
word=None)

9.1. openpyxl package 117


openpyxl Documentation, Release 2.4.0

Bases: openpyxl.descriptors.serialisable.Serialisable,
openpyxl.worksheet.protection._Protected
algorithmName
Values must be of type <class ‘str’>
content
Values must be of type <class ‘bool’>
hashValue
hash_password(password)
objects
Values must be of type <class ‘bool’>
saltValue
spinCount
Values must be of type <class ‘int’>
tagname = ‘sheetProtection’

openpyxl.chartsheet.publish module
class openpyxl.chartsheet.publish.WebPublishItem(id=None, divId=None, source-
Type=None, sourceRef=None,
sourceObject=None, destination-
File=None, title=None, autoRepub-
lish=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
autoRepublish
Values must be of type <class ‘bool’>
destinationFile
Values must be of type <class ‘str’>
divId
Values must be of type <class ‘str’>
id
Values must be of type <class ‘int’>
sourceObject
Values must be of type <class ‘str’>
sourceRef
Values must be of type <class ‘str’>
sourceType
Value must be one of {‘query’, ‘sheet’, ‘pivotTable’, ‘label’, ‘printArea’, ‘autoFilter’, ‘range’, ‘chart’}
tagname = ‘webPublishItem’
title
Values must be of type <class ‘str’>
class openpyxl.chartsheet.publish.WebPublishItems(count=None, webPublishItem=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
count
Values must be of type <class ‘int’>
tagname = ‘WebPublishItems’

118 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

webPublishItem
A sequence (list or tuple) that may only contain objects of the declared type

openpyxl.chartsheet.relation module
class openpyxl.chartsheet.relation.DrawingHF(id=None, lho=None, lhe=None, lhf=None,
cho=None, che=None, chf=None, rho=None,
rhe=None, rhf=None, lfo=None, lfe=None,
lff=None, cfo=None, cfe=None, cff=None,
rfo=None, rfe=None, rff=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cfe
Values must be of type <class ‘int’>
cff
Values must be of type <class ‘int’>
cfo
Values must be of type <class ‘int’>
che
Values must be of type <class ‘int’>
chf
Values must be of type <class ‘int’>
cho
Values must be of type <class ‘int’>
id
Values must be of type <class ‘str’>
lfe
Values must be of type <class ‘int’>
lff
Values must be of type <class ‘int’>
lfo
Values must be of type <class ‘int’>
lhe
Values must be of type <class ‘int’>
lhf
Values must be of type <class ‘int’>
lho
Values must be of type <class ‘int’>
rfe
Values must be of type <class ‘int’>
rff
Values must be of type <class ‘int’>
rfo
Values must be of type <class ‘int’>
rhe
Values must be of type <class ‘int’>

9.1. openpyxl package 119


openpyxl Documentation, Release 2.4.0

rhf
Values must be of type <class ‘int’>
rho
Values must be of type <class ‘int’>
class openpyxl.chartsheet.relation.SheetBackgroundPicture(id)
Bases: openpyxl.descriptors.serialisable.Serialisable
id
Values must be of type <class ‘str’>
tagname = ‘picture’

openpyxl.chartsheet.views module
class openpyxl.chartsheet.views.ChartsheetView(tabSelected=None, zoomScale=None,
workbookViewId=0, zoomToFit=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
tabSelected
Values must be of type <class ‘bool’>
tagname = ‘sheetView’
workbookViewId
Values must be of type <class ‘int’>
zoomScale
Values must be of type <class ‘int’>
zoomToFit
Values must be of type <class ‘bool’>
class openpyxl.chartsheet.views.ChartsheetViewList(sheetView=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
sheetView
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘sheetViews’

openpyxl.comments package

Submodules

openpyxl.comments.author module
class openpyxl.comments.author.AuthorList(author=())
Bases: openpyxl.descriptors.serialisable.Serialisable
author
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘authors’

120 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.comments.comments module
class openpyxl.comments.comments.Comment(text, author)
Bases: object
parent
text
Any comment text stripped of all formatting.

openpyxl.comments.properties module
class openpyxl.comments.properties.Comment(ref=’‘, authorId=0, guid=None, shapeId=0,
text=None, commentPr=None, author=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
author
Values must be of type <class ‘str’>
authorId
Values must be of type <class ‘int’>
commentPr
Values must be of type <class ‘openpyxl.comments.properties.Properties’>
content
Remove all inline formatting and stuff
guid
ref
Values must be of type <class ‘str’>
shapeId
Values must be of type <class ‘int’>
tagname = ‘comment’
text
Values must be of type <class ‘openpyxl.cell.text.Text’>
class openpyxl.comments.properties.CommentSheet(authors=None, commentList=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
authors
Values must be of type <class ‘openpyxl.comments.author.AuthorList’>
commentList
Wrap a sequence in an containing object
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
tagname = ‘comments’
to_tree()
class openpyxl.comments.properties.ObjectAnchor(moveWithCells=None, sizeWith-
Cells=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
moveWithCells
Values must be of type <class ‘bool’>
sizeWithCells
Values must be of type <class ‘bool’>

9.1. openpyxl package 121


openpyxl Documentation, Release 2.4.0

class openpyxl.comments.properties.Properties(locked=None, defaultSize=None,


_print=None, disabled=None, uiOb-
ject=None, autoFill=None, autoLine=None,
altText=None, textHAlign=None,
textVAlign=None, lockText=None, just-
LastX=None, autoScale=None, rowHid-
den=None, colHidden=None, an-
chor=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
altText
Values must be of type <class ‘str’>
anchor
Values must be of type <class ‘openpyxl.comments.properties.ObjectAnchor’>
autoFill
Values must be of type <class ‘bool’>
autoLine
Values must be of type <class ‘bool’>
autoScale
Values must be of type <class ‘bool’>
colHidden
Values must be of type <class ‘bool’>
defaultSize
Values must be of type <class ‘bool’>
disabled
Values must be of type <class ‘bool’>
justLastX
Values must be of type <class ‘bool’>
lockText
Values must be of type <class ‘bool’>
locked
Values must be of type <class ‘bool’>
rowHidden
Values must be of type <class ‘bool’>
textHAlign
Value must be one of {‘right’, ‘justify’, ‘center’, ‘distributed’, ‘left’}
textVAlign
Value must be one of {‘justify’, ‘center’, ‘top’, ‘bottom’, ‘distributed’}
uiObject
Values must be of type <class ‘bool’>

openpyxl.comments.reader module
openpyxl.comments.reader.get_comments_file(worksheet_path, archive, valid_files)
Returns the XML filename in the archive which contains the comments for the spreadsheet with codename
sheet_codename.
openpyxl.comments.reader.read_comments(ws, xml_source)
Given a worksheet and the XML of its comments file, assigns comments to cells

122 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.comments.writer module
class openpyxl.comments.writer.CommentWriter(sheet)
Bases: object
write_comments()
Create list of comments and authors
write_comments_vml()

openpyxl.descriptors package

class openpyxl.descriptors.MetaSerialisable
Bases: type
class openpyxl.descriptors.MetaStrict
Bases: type
class openpyxl.descriptors.Strict
Bases: object

Submodules

openpyxl.descriptors.base module
class openpyxl.descriptors.base.ASCII(*args, **kw)
Bases: openpyxl.descriptors.base.Typed
expected_type
alias of bytes
class openpyxl.descriptors.base.Alias(alias)
Bases: openpyxl.descriptors.base.Descriptor
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”)
class openpyxl.descriptors.base.Bool(*args, **kw)
Bases: openpyxl.descriptors.base.Convertible
expected_type
alias of bool
class openpyxl.descriptors.base.Convertible(*args, **kw)
Bases: openpyxl.descriptors.base.Typed
Values must be convertible to a particular type
class openpyxl.descriptors.base.DateTime(*args, **kw)
Bases: openpyxl.descriptors.base.Typed
expected_type
alias of datetime
class openpyxl.descriptors.base.Default(name=None, **kw)
Bases: openpyxl.descriptors.base.Typed
When called returns an instance of the expected type. Additional default values can be passed in to the descriptor
class openpyxl.descriptors.base.Descriptor(name=None, **kw)
Bases: object

9.1. openpyxl package 123


openpyxl Documentation, Release 2.4.0

class openpyxl.descriptors.base.Float(*args, **kw)


Bases: openpyxl.descriptors.base.Convertible
expected_type
alias of float
class openpyxl.descriptors.base.Integer(*args, **kw)
Bases: openpyxl.descriptors.base.Convertible
expected_type
alias of int
class openpyxl.descriptors.base.Length(name=None, **kw)
Bases: openpyxl.descriptors.base.Descriptor
class openpyxl.descriptors.base.MatchPattern(name=None, **kw)
Bases: openpyxl.descriptors.base.Descriptor
Values must match a regex pattern
allow_none = False
class openpyxl.descriptors.base.Max(**kw)
Bases: openpyxl.descriptors.base.Convertible
Values must be less than a max value
allow_none = False
expected_type
alias of float
class openpyxl.descriptors.base.Min(**kw)
Bases: openpyxl.descriptors.base.Convertible
Values must be greater than a min value
allow_none = False
expected_type
alias of float
class openpyxl.descriptors.base.MinMax(**kw)
Bases: openpyxl.descriptors.base.Min, openpyxl.descriptors.base.Max
Values must be greater than min value and less than a max one
class openpyxl.descriptors.base.NoneSet(name=None, **kw)
Bases: openpyxl.descriptors.base.Set
‘none’ will be treated as None
class openpyxl.descriptors.base.Set(name=None, **kw)
Bases: openpyxl.descriptors.base.Descriptor
Value can only be from a set of know values
class openpyxl.descriptors.base.String(*args, **kw)
Bases: openpyxl.descriptors.base.Typed
expected_type
alias of str
class openpyxl.descriptors.base.Tuple(*args, **kw)
Bases: openpyxl.descriptors.base.Typed

124 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

expected_type
alias of tuple
class openpyxl.descriptors.base.Typed(*args, **kw)
Bases: openpyxl.descriptors.base.Descriptor
Values must of a particular type
allow_none = False
expected_type
alias of NoneType
nested = False

openpyxl.descriptors.excel module
class openpyxl.descriptors.excel.Base64Binary(name=None, **kw)
Bases: openpyxl.descriptors.base.MatchPattern
pattern = ‘^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$’
class openpyxl.descriptors.excel.Extension(uri=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
uri
Values must be of type <class ‘str’>
class openpyxl.descriptors.excel.ExtensionList(ext=())
Bases: openpyxl.descriptors.serialisable.Serialisable
ext
A sequence (list or tuple) that may only contain objects of the declared type
class openpyxl.descriptors.excel.Guid(name=None, **kw)
Bases: openpyxl.descriptors.base.MatchPattern
pattern = ‘{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\\}’
class openpyxl.descriptors.excel.HexBinary(name=None, **kw)
Bases: openpyxl.descriptors.base.MatchPattern
pattern = ‘[0-9a-fA-F]+$’
class openpyxl.descriptors.excel.Percentage(name=None, **kw)
Bases: openpyxl.descriptors.base.MatchPattern
pattern = ‘((100)|([0-9][0-9]?))(\\.[0-9][0-9]?)?%’
class openpyxl.descriptors.excel.Relation(*args, **kw)
Bases: openpyxl.descriptors.base.String
allow_none = True
namespace = ‘http://schemas.openxmlformats.org/officeDocument/2006/relationships’
class openpyxl.descriptors.excel.TextPoint(**kw)
Bases: openpyxl.descriptors.base.MinMax
Size in hundredths of points. In theory other units of measurement can be used but these are unbounded
expected_type
alias of int
max = 400000
min = -400000

9.1. openpyxl package 125


openpyxl Documentation, Release 2.4.0

class openpyxl.descriptors.excel.UniversalMeasure(name=None, **kw)


Bases: openpyxl.descriptors.base.MatchPattern
pattern = ‘[0-9]+(\\.[0-9]+)?(mm|cm|in|pt|pc|pi)’

openpyxl.descriptors.namespace module
openpyxl.descriptors.namespace.namespaced(obj, tagname, namespace=None)
Utility to create a namespaced tag for an object

openpyxl.descriptors.nested module
class openpyxl.descriptors.nested.EmptyTag(*args, **kw)
Bases: openpyxl.descriptors.nested.Nested, openpyxl.descriptors.base.Bool
Boolean if a tag exists or not.
from_tree(node)
to_tree(tagname=None, value=None, namespace=None)
class openpyxl.descriptors.nested.Nested(name=None, **kw)
Bases: openpyxl.descriptors.base.Descriptor
attribute = ‘val’
from_tree(node)
nested = True
to_tree(tagname=None, value=None, namespace=None)
class openpyxl.descriptors.nested.NestedBool(*args, **kw)
Bases: openpyxl.descriptors.nested.NestedValue, openpyxl.descriptors.base.Bool

from_tree(node)
class openpyxl.descriptors.nested.NestedFloat(*args, **kw)
Bases: openpyxl.descriptors.nested.NestedValue, openpyxl.descriptors.base.Float
class openpyxl.descriptors.nested.NestedInteger(*args, **kw)
Bases: openpyxl.descriptors.nested.NestedValue, openpyxl.descriptors.base.Integer
class openpyxl.descriptors.nested.NestedMinMax(**kw)
Bases: openpyxl.descriptors.nested.Nested, openpyxl.descriptors.base.MinMax
class openpyxl.descriptors.nested.NestedNoneSet(name=None, **kw)
Bases: openpyxl.descriptors.nested.Nested, openpyxl.descriptors.base.NoneSet
class openpyxl.descriptors.nested.NestedSet(name=None, **kw)
Bases: openpyxl.descriptors.nested.Nested, openpyxl.descriptors.base.Set
class openpyxl.descriptors.nested.NestedString(*args, **kw)
Bases: openpyxl.descriptors.nested.NestedValue, openpyxl.descriptors.base.String
class openpyxl.descriptors.nested.NestedText(*args, **kw)
Bases: openpyxl.descriptors.nested.NestedValue
Represents any nested tag with the value as the contents of the tag
from_tree(node)
to_tree(tagname=None, value=None, namespace=None)

126 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.descriptors.nested.NestedValue(*args, **kw)


Bases: openpyxl.descriptors.nested.Nested, openpyxl.descriptors.base.Convertible
Nested tag storing the value on the ‘val’ attribute

openpyxl.descriptors.sequence module
class openpyxl.descriptors.sequence.NestedSequence(name=None, **kw)
Bases: openpyxl.descriptors.sequence.Sequence
Wrap a sequence in an containing object
count = False
from_tree(node)
to_tree(tagname, obj, namespace=None)
class openpyxl.descriptors.sequence.Sequence(name=None, **kw)
Bases: openpyxl.descriptors.base.Descriptor
A sequence (list or tuple) that may only contain objects of the declared type
expected_type
alias of NoneType
idx_base = 0
seq_types = (<class ‘list’>, <class ‘tuple’>)
to_tree(tagname, obj, namespace=None)
Convert the sequence represented by the descriptor to an XML element
unique = False
class openpyxl.descriptors.sequence.ValueSequence(name=None, **kw)
Bases: openpyxl.descriptors.sequence.Sequence
A sequence of primitive types that are stored as a single attribute. “val” is the default attribute
attribute = ‘val’
from_tree(node)
to_tree(tagname, obj, namespace=None)

openpyxl.descriptors.serialisable module
class openpyxl.descriptors.serialisable.Serialisable
Bases: openpyxl.descriptors._Serialisable
Objects can serialise to XML their attributes and child objects. The following class attributes are created by
the metaclass at runtime: __attrs__ = attributes __nested__ = single-valued child treated as an attribute __ele-
ments__ = child elements
classmethod from_tree(node)
Create object from XML
idx_base = 0
namespace = None
tagname
to_tree(tagname=None, idx=None, namespace=None)

9.1. openpyxl package 127


openpyxl Documentation, Release 2.4.0

openpyxl.drawing package

Submodules

openpyxl.drawing.colors module
class openpyxl.drawing.colors.ColorChoice(scrgbClr=None, srgbClr=None, hslClr=None,
sysClr=None, schemeClr=None, prstClr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
hslClr
Values must be of type <class ‘openpyxl.drawing.colors.HSLColor’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
prstClr
Value must be one of {‘lightSlateGray’, ‘oldLace’, ‘ltPink’, ‘lightSteelBlue’, ‘peachPuff’, ‘steel-
Blue’, ‘dkViolet’, ‘greenYellow’, ‘darkGrey’, ‘moccasin’, ‘snow’, ‘yellow’, ‘firebrick’, ‘medTurquoise’,
‘gray’, ‘lightSkyBlue’, ‘darkOrchid’, ‘medSeaGreen’, ‘salmon’, ‘mistyRose’, ‘black’, ‘aquamarine’,
‘dkOrange’, ‘mintCream’, ‘red’, ‘magenta’, ‘ltSalmon’, ‘indianRed’, ‘dkGoldenrod’, ‘lightSeaGreen’,
‘paleVioletRed’, ‘royalBlue’, ‘darkSlateBlue’, ‘pink’, ‘crimson’, ‘darkGoldenrod’, ‘darkTurquoise’,
‘dimGray’, ‘tomato’, ‘dkOliveGreen’, ‘springGreen’, ‘dkKhaki’, ‘mediumSlateBlue’, ‘lightBlue’,
‘lavenderBlush’, ‘darkViolet’, ‘lightCyan’, ‘bisque’, ‘lightSlateGrey’, ‘oliveDrab’, ‘peru’, ‘darkBlue’,
‘wheat’, ‘blanchedAlmond’, ‘maroon’, ‘midnightBlue’, ‘darkGray’, ‘grey’, ‘antiqueWhite’, ‘darkOrange’,
‘dkGreen’, ‘goldenrod’, ‘orchid’, ‘navy’, ‘ltGray’, ‘ltSkyBlue’, ‘ltSteelBlue’, ‘medSlateBlue’, ‘nava-
joWhite’, ‘violet’, ‘gold’, ‘dkSlateGrey’, ‘dkTurquoise’, ‘paleGoldenrod’, ‘dkGray’, ‘medPurple’, ‘medi-
umPurple’, ‘darkGreen’, ‘darkSeaGreen’, ‘saddleBrown’, ‘dkRed’, ‘skyBlue’, ‘teal’, ‘ghostWhite’, ‘medi-
umVioletRed’, ‘ltSlateGray’, ‘cornsilk’, ‘seaGreen’, ‘silver’, ‘honeydew’, ‘ltGreen’, ‘dkSeaGreen’, ‘deep-
Pink’, ‘medAquamarine’, ‘dkMagenta’, ‘lightCoral’, ‘medBlue’, ‘medOrchid’, ‘darkSlateGray’, ‘aqua’,
‘beige’, ‘ltSeaGreen’, ‘lemonChiffon’, ‘orange’, ‘whiteSmoke’, ‘blue’, ‘lightGoldenrodYellow’, ‘cyan’,
‘dkCyan’, ‘indigo’, ‘chocolate’, ‘lightSalmon’, ‘coral’, ‘darkSalmon’, ‘dkGrey’, ‘sienna’, ‘dkSalmon’,
‘papayaWhip’, ‘darkCyan’, ‘thistle’, ‘khaki’, ‘lightPink’, ‘dimGrey’, ‘ltGrey’, ‘cornflowerBlue’, ‘ltSlate-
Grey’, ‘purple’, ‘orangeRed’, ‘ivory’, ‘dkOrchid’, ‘floralWhite’, ‘linen’, ‘rosyBrown’, ‘gainsboro’, ‘olive’,
‘hotPink’, ‘lightGreen’, ‘dkBlue’, ‘dodgerBlue’, ‘darkRed’, ‘blueViolet’, ‘darkSlateGrey’, ‘ltGolden-
rodYellow’, ‘mediumOrchid’, ‘burlyWood’, ‘ltYellow’, ‘lawnGreen’, ‘azure’, ‘limeGreen’, ‘lightYel-
low’, ‘dkSlateBlue’, ‘ltBlue’, ‘slateBlue’, ‘mediumAquamarine’, ‘tan’, ‘green’, ‘slateGrey’, ‘lightGray’,
‘medVioletRed’, ‘dkSlateGray’, ‘lavender’, ‘darkKhaki’, ‘cadetBlue’, ‘mediumSeaGreen’, ‘darkOlive-
Green’, ‘paleGreen’, ‘ltCoral’, ‘mediumBlue’, ‘sandyBrown’, ‘paleTurquoise’, ‘mediumSpringGreen’,
‘brown’, ‘fuchsia’, ‘deepSkyBlue’, ‘plum’, ‘seaShell’, ‘ltCyan’, ‘forestGreen’, ‘slateGray’, ‘lightGrey’,
‘chartreuse’, ‘aliceBlue’, ‘lime’, ‘mediumTurquoise’, ‘darkMagenta’, ‘medSpringGreen’, ‘yellowGreen’,
‘powderBlue’, ‘turquoise’, ‘white’}
schemeClr
Value must be one of {‘accent3’, ‘phClr’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘bg1’, ‘lt2’, ‘accent2’,
‘accent1’, ‘dk2’, ‘lt1’, ‘accent4’, ‘bg2’, ‘folHlink’, ‘tx1’, ‘tx2’}
scrgbClr
Values must be of type <class ‘openpyxl.drawing.colors.RGBPercent’>
srgbClr
Values must be of type <class ‘str’>
sysClr
Values must be of type <class ‘openpyxl.drawing.colors.SystemColor’>
tagname = ‘colorChoice’
class openpyxl.drawing.colors.ColorChoiceDescriptor(*args, **kw)
Bases: openpyxl.descriptors.base.Typed

128 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

Objects can choose from 7 different kinds of color system. Assume RGBHex if a string is passed in.
allow_none = True
expected_type
alias of ColorChoice
class openpyxl.drawing.colors.ColorMapping(bg1=’lt1’, tx1=’dk1’, bg2=’lt2’, tx2=’dk2’,
accent1=’accent1’, accent2=’accent2’,
accent3=’accent3’, accent4=’accent4’,
accent5=’accent5’, accent6=’accent6’,
hlink=’hlink’, folHlink=’folHlink’, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
accent1
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
accent2
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
accent3
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
accent4
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
accent5
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
accent6
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
bg1
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
bg2
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
folHlink
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
hlink
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
tagname = ‘clrMapOvr’
tx1
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}

9.1. openpyxl package 129


openpyxl Documentation, Release 2.4.0

tx2
Value must be one of {‘accent3’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘lt2’, ‘accent2’, ‘accent1’, ‘dk2’,
‘lt1’, ‘accent4’, ‘folHlink’}
class openpyxl.drawing.colors.HSLColor(hue=None, sat=None, lum=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
hue
Values must be of type <class ‘int’>
lum
Values must be of type <class ‘float’>
sat
Values must be of type <class ‘float’>
tagname = ‘hslClr’
class openpyxl.drawing.colors.RGBPercent(r=None, g=None, b=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
b
Values must be of type <class ‘float’>
g
Values must be of type <class ‘float’>
r
Values must be of type <class ‘float’>
tagname = ‘rgbClr’
class openpyxl.drawing.colors.SystemColor(val=’bg1’, lastClr=None, tint=None, shade=None,
comp=None, inv=None, gray=None, alpha=None,
alphaOff=None, alphaMod=None, hue=None,
hueOff=None, hueMod=None, sat=None,
satOff=None, satMod=None, lum=None,
lumOff=None, lumMod=None, red=None,
redOff=None, redMod=None, green=None,
greenOff=None, greenMod=None, blue=None,
blueOff=None, blueMod=None, gamma=None,
invGamma=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
alpha
Values must be of type <class ‘int’>
alphaMod
Values must be of type <class ‘int’>
alphaOff
Values must be of type <class ‘int’>
blue
Values must be of type <class ‘int’>
blueMod
Values must be of type <class ‘int’>
blueOff
Values must be of type <class ‘int’>

130 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

comp
Values must be of type <class ‘openpyxl.drawing.colors.Transform’>
gamma
Values must be of type <class ‘openpyxl.drawing.colors.Transform’>
gray
Values must be of type <class ‘openpyxl.drawing.colors.Transform’>
green
Values must be of type <class ‘int’>
greenMod
Values must be of type <class ‘int’>
greenOff
Values must be of type <class ‘int’>
hue
Values must be of type <class ‘int’>
hueMod
Values must be of type <class ‘int’>
hueOff
Values must be of type <class ‘int’>
inv
Values must be of type <class ‘openpyxl.drawing.colors.Transform’>
invGamma
Values must be of type <class ‘openpyxl.drawing.colors.Transform’>
lastClr
Values must be of type <class ‘openpyxl.styles.colors.RGB’>
lum
Values must be of type <class ‘int’>
lumMod
Values must be of type <class ‘int’>
lumOff
Values must be of type <class ‘int’>
red
Values must be of type <class ‘int’>
redMod
Values must be of type <class ‘int’>
redOff
Values must be of type <class ‘int’>
sat
Values must be of type <class ‘int’>
satMod
Values must be of type <class ‘int’>
satOff
Values must be of type <class ‘int’>

9.1. openpyxl package 131


openpyxl Documentation, Release 2.4.0

shade
Values must be of type <class ‘int’>
tagname = ‘sysClr’
tint
Values must be of type <class ‘int’>
val
Value must be one of {‘accent3’, ‘phClr’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘bg1’, ‘lt2’, ‘accent2’,
‘accent1’, ‘dk2’, ‘lt1’, ‘accent4’, ‘bg2’, ‘folHlink’, ‘tx1’, ‘tx2’}
class openpyxl.drawing.colors.Transform
Bases: openpyxl.descriptors.serialisable.Serialisable

openpyxl.drawing.drawing module
class openpyxl.drawing.drawing.Drawing
Bases: object
a drawing object - eg container for shapes or charts we assume user specifies dimensions in pixels; units are
converted to EMU in the drawing part
anchor
count = 0
get_emu_dimensions()
return (x, y, w, h) in EMU
height
set_dimension(w=0, h=0)
width

openpyxl.drawing.effect module
class openpyxl.drawing.effect.AlphaBiLevelEffect(thresh=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
thresh
Values must be of type <class ‘int’>
class openpyxl.drawing.effect.AlphaCeilingEffect
Bases: openpyxl.descriptors.serialisable.Serialisable
class openpyxl.drawing.effect.AlphaFloorEffect
Bases: openpyxl.descriptors.serialisable.Serialisable
class openpyxl.drawing.effect.AlphaInverseEffect
Bases: openpyxl.descriptors.serialisable.Serialisable
class openpyxl.drawing.effect.AlphaModulateEffect(cont=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cont
Values must be of type <class ‘openpyxl.drawing.effect.EffectContainer’>
class openpyxl.drawing.effect.AlphaModulateFixedEffect(amt=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
amt
Values must be of type <class ‘int’>

132 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.drawing.effect.AlphaReplaceEffect(a=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
a
Values must be of type <class ‘int’>
class openpyxl.drawing.effect.BiLevelEffect(thresh=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
thresh
Values must be of type <class ‘int’>
class openpyxl.drawing.effect.BlurEffect(rad=None, grow=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
grow
Values must be of type <class ‘bool’>
rad
Values must be of type <class ‘float’>
class openpyxl.drawing.effect.Color
Bases: openpyxl.descriptors.serialisable.Serialisable
class openpyxl.drawing.effect.ColorChangeEffect(useA=None, clrFrom=None,
clrTo=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
clrFrom
Values must be of type <class ‘openpyxl.drawing.effect.Color’>
clrTo
Values must be of type <class ‘openpyxl.drawing.effect.Color’>
useA
Values must be of type <class ‘bool’>
class openpyxl.drawing.effect.ColorReplaceEffect
Bases: openpyxl.descriptors.serialisable.Serialisable
class openpyxl.drawing.effect.DuotoneEffect
Bases: openpyxl.descriptors.serialisable.Serialisable
class openpyxl.drawing.effect.EffectContainer(type=None, name=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
name
Values must be of type <class ‘str’>
type
Value must be one of {‘sib’, ‘tree’}
class openpyxl.drawing.effect.EffectList(blur=None, fillOverlay=None, glow=None, inner-
Shdw=None, outerShdw=None, prstShdw=None, re-
flection=None, softEdge=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
blur
Values must be of type <class ‘openpyxl.drawing.effect.BlurEffect’>
fillOverlay
Values must be of type <class ‘openpyxl.drawing.effect.FillOverlayEffect’>

9.1. openpyxl package 133


openpyxl Documentation, Release 2.4.0

glow
Values must be of type <class ‘openpyxl.drawing.effect.GlowEffect’>
innerShdw
Values must be of type <class ‘openpyxl.drawing.effect.InnerShadowEffect’>
outerShdw
Values must be of type <class ‘openpyxl.drawing.effect.OuterShadowEffect’>
prstShdw
Values must be of type <class ‘openpyxl.drawing.effect.PresetShadowEffect’>
reflection
Values must be of type <class ‘openpyxl.drawing.effect.ReflectionEffect’>
softEdge
Values must be of type <class ‘openpyxl.drawing.effect.SoftEdgesEffect’>
class openpyxl.drawing.effect.FillOverlayEffect(blend=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
blend
Value must be one of {‘over’, ‘mult’, ‘screen’, ‘darken’, ‘lighten’}
class openpyxl.drawing.effect.GlowEffect(rad=None, **kw)
Bases: openpyxl.drawing.colors.ColorChoice
hslClr
Values must be of type <class ‘openpyxl.drawing.colors.HSLColor’>
prstClr
Value must be one of {‘lightSlateGray’, ‘oldLace’, ‘ltPink’, ‘lightSteelBlue’, ‘peachPuff’, ‘steel-
Blue’, ‘dkViolet’, ‘greenYellow’, ‘darkGrey’, ‘moccasin’, ‘snow’, ‘yellow’, ‘firebrick’, ‘medTurquoise’,
‘gray’, ‘lightSkyBlue’, ‘darkOrchid’, ‘medSeaGreen’, ‘salmon’, ‘mistyRose’, ‘black’, ‘aquamarine’,
‘dkOrange’, ‘mintCream’, ‘red’, ‘magenta’, ‘ltSalmon’, ‘indianRed’, ‘dkGoldenrod’, ‘lightSeaGreen’,
‘paleVioletRed’, ‘royalBlue’, ‘darkSlateBlue’, ‘pink’, ‘crimson’, ‘darkGoldenrod’, ‘darkTurquoise’,
‘dimGray’, ‘tomato’, ‘dkOliveGreen’, ‘springGreen’, ‘dkKhaki’, ‘mediumSlateBlue’, ‘lightBlue’,
‘lavenderBlush’, ‘darkViolet’, ‘lightCyan’, ‘bisque’, ‘lightSlateGrey’, ‘oliveDrab’, ‘peru’, ‘darkBlue’,
‘wheat’, ‘blanchedAlmond’, ‘maroon’, ‘midnightBlue’, ‘darkGray’, ‘grey’, ‘antiqueWhite’, ‘darkOrange’,
‘dkGreen’, ‘goldenrod’, ‘orchid’, ‘navy’, ‘ltGray’, ‘ltSkyBlue’, ‘ltSteelBlue’, ‘medSlateBlue’, ‘nava-
joWhite’, ‘violet’, ‘gold’, ‘dkSlateGrey’, ‘dkTurquoise’, ‘paleGoldenrod’, ‘dkGray’, ‘medPurple’, ‘medi-
umPurple’, ‘darkGreen’, ‘darkSeaGreen’, ‘saddleBrown’, ‘dkRed’, ‘skyBlue’, ‘teal’, ‘ghostWhite’, ‘medi-
umVioletRed’, ‘ltSlateGray’, ‘cornsilk’, ‘seaGreen’, ‘silver’, ‘honeydew’, ‘ltGreen’, ‘dkSeaGreen’, ‘deep-
Pink’, ‘medAquamarine’, ‘dkMagenta’, ‘lightCoral’, ‘medBlue’, ‘medOrchid’, ‘darkSlateGray’, ‘aqua’,
‘beige’, ‘ltSeaGreen’, ‘lemonChiffon’, ‘orange’, ‘whiteSmoke’, ‘blue’, ‘lightGoldenrodYellow’, ‘cyan’,
‘dkCyan’, ‘indigo’, ‘chocolate’, ‘lightSalmon’, ‘coral’, ‘darkSalmon’, ‘dkGrey’, ‘sienna’, ‘dkSalmon’,
‘papayaWhip’, ‘darkCyan’, ‘thistle’, ‘khaki’, ‘lightPink’, ‘dimGrey’, ‘ltGrey’, ‘cornflowerBlue’, ‘ltSlate-
Grey’, ‘purple’, ‘orangeRed’, ‘ivory’, ‘dkOrchid’, ‘floralWhite’, ‘linen’, ‘rosyBrown’, ‘gainsboro’, ‘olive’,
‘hotPink’, ‘lightGreen’, ‘dkBlue’, ‘dodgerBlue’, ‘darkRed’, ‘blueViolet’, ‘darkSlateGrey’, ‘ltGolden-
rodYellow’, ‘mediumOrchid’, ‘burlyWood’, ‘ltYellow’, ‘lawnGreen’, ‘azure’, ‘limeGreen’, ‘lightYel-
low’, ‘dkSlateBlue’, ‘ltBlue’, ‘slateBlue’, ‘mediumAquamarine’, ‘tan’, ‘green’, ‘slateGrey’, ‘lightGray’,
‘medVioletRed’, ‘dkSlateGray’, ‘lavender’, ‘darkKhaki’, ‘cadetBlue’, ‘mediumSeaGreen’, ‘darkOlive-
Green’, ‘paleGreen’, ‘ltCoral’, ‘mediumBlue’, ‘sandyBrown’, ‘paleTurquoise’, ‘mediumSpringGreen’,
‘brown’, ‘fuchsia’, ‘deepSkyBlue’, ‘plum’, ‘seaShell’, ‘ltCyan’, ‘forestGreen’, ‘slateGray’, ‘lightGrey’,
‘chartreuse’, ‘aliceBlue’, ‘lime’, ‘mediumTurquoise’, ‘darkMagenta’, ‘medSpringGreen’, ‘yellowGreen’,
‘powderBlue’, ‘turquoise’, ‘white’}
rad
Values must be of type <class ‘float’>

134 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

schemeClr
Value must be one of {‘accent3’, ‘phClr’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘bg1’, ‘lt2’, ‘accent2’,
‘accent1’, ‘dk2’, ‘lt1’, ‘accent4’, ‘bg2’, ‘folHlink’, ‘tx1’, ‘tx2’}
scrgbClr
Values must be of type <class ‘openpyxl.drawing.colors.RGBPercent’>
srgbClr
Values must be of type <class ‘str’>
sysClr
Values must be of type <class ‘openpyxl.drawing.colors.SystemColor’>
class openpyxl.drawing.effect.GrayscaleEffect
Bases: openpyxl.descriptors.serialisable.Serialisable
class openpyxl.drawing.effect.HSLEffect(hue=None, sat=None, lum=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
hue
Values must be of type <class ‘int’>
lum
Values must be of type <class ‘int’>
sat
Values must be of type <class ‘int’>
class openpyxl.drawing.effect.InnerShadowEffect(blurRad=None, dist=None, dir=None,
**kw)
Bases: openpyxl.drawing.colors.ColorChoice
blurRad
Values must be of type <class ‘float’>
dir
Values must be of type <class ‘int’>
dist
Values must be of type <class ‘float’>
hslClr
Values must be of type <class ‘openpyxl.drawing.colors.HSLColor’>
prstClr
Value must be one of {‘lightSlateGray’, ‘oldLace’, ‘ltPink’, ‘lightSteelBlue’, ‘peachPuff’, ‘steel-
Blue’, ‘dkViolet’, ‘greenYellow’, ‘darkGrey’, ‘moccasin’, ‘snow’, ‘yellow’, ‘firebrick’, ‘medTurquoise’,
‘gray’, ‘lightSkyBlue’, ‘darkOrchid’, ‘medSeaGreen’, ‘salmon’, ‘mistyRose’, ‘black’, ‘aquamarine’,
‘dkOrange’, ‘mintCream’, ‘red’, ‘magenta’, ‘ltSalmon’, ‘indianRed’, ‘dkGoldenrod’, ‘lightSeaGreen’,
‘paleVioletRed’, ‘royalBlue’, ‘darkSlateBlue’, ‘pink’, ‘crimson’, ‘darkGoldenrod’, ‘darkTurquoise’,
‘dimGray’, ‘tomato’, ‘dkOliveGreen’, ‘springGreen’, ‘dkKhaki’, ‘mediumSlateBlue’, ‘lightBlue’,
‘lavenderBlush’, ‘darkViolet’, ‘lightCyan’, ‘bisque’, ‘lightSlateGrey’, ‘oliveDrab’, ‘peru’, ‘darkBlue’,
‘wheat’, ‘blanchedAlmond’, ‘maroon’, ‘midnightBlue’, ‘darkGray’, ‘grey’, ‘antiqueWhite’, ‘darkOrange’,
‘dkGreen’, ‘goldenrod’, ‘orchid’, ‘navy’, ‘ltGray’, ‘ltSkyBlue’, ‘ltSteelBlue’, ‘medSlateBlue’, ‘nava-
joWhite’, ‘violet’, ‘gold’, ‘dkSlateGrey’, ‘dkTurquoise’, ‘paleGoldenrod’, ‘dkGray’, ‘medPurple’, ‘medi-
umPurple’, ‘darkGreen’, ‘darkSeaGreen’, ‘saddleBrown’, ‘dkRed’, ‘skyBlue’, ‘teal’, ‘ghostWhite’, ‘medi-
umVioletRed’, ‘ltSlateGray’, ‘cornsilk’, ‘seaGreen’, ‘silver’, ‘honeydew’, ‘ltGreen’, ‘dkSeaGreen’, ‘deep-
Pink’, ‘medAquamarine’, ‘dkMagenta’, ‘lightCoral’, ‘medBlue’, ‘medOrchid’, ‘darkSlateGray’, ‘aqua’,
‘beige’, ‘ltSeaGreen’, ‘lemonChiffon’, ‘orange’, ‘whiteSmoke’, ‘blue’, ‘lightGoldenrodYellow’, ‘cyan’,
‘dkCyan’, ‘indigo’, ‘chocolate’, ‘lightSalmon’, ‘coral’, ‘darkSalmon’, ‘dkGrey’, ‘sienna’, ‘dkSalmon’,

9.1. openpyxl package 135


openpyxl Documentation, Release 2.4.0

‘papayaWhip’, ‘darkCyan’, ‘thistle’, ‘khaki’, ‘lightPink’, ‘dimGrey’, ‘ltGrey’, ‘cornflowerBlue’, ‘ltSlate-


Grey’, ‘purple’, ‘orangeRed’, ‘ivory’, ‘dkOrchid’, ‘floralWhite’, ‘linen’, ‘rosyBrown’, ‘gainsboro’, ‘olive’,
‘hotPink’, ‘lightGreen’, ‘dkBlue’, ‘dodgerBlue’, ‘darkRed’, ‘blueViolet’, ‘darkSlateGrey’, ‘ltGolden-
rodYellow’, ‘mediumOrchid’, ‘burlyWood’, ‘ltYellow’, ‘lawnGreen’, ‘azure’, ‘limeGreen’, ‘lightYel-
low’, ‘dkSlateBlue’, ‘ltBlue’, ‘slateBlue’, ‘mediumAquamarine’, ‘tan’, ‘green’, ‘slateGrey’, ‘lightGray’,
‘medVioletRed’, ‘dkSlateGray’, ‘lavender’, ‘darkKhaki’, ‘cadetBlue’, ‘mediumSeaGreen’, ‘darkOlive-
Green’, ‘paleGreen’, ‘ltCoral’, ‘mediumBlue’, ‘sandyBrown’, ‘paleTurquoise’, ‘mediumSpringGreen’,
‘brown’, ‘fuchsia’, ‘deepSkyBlue’, ‘plum’, ‘seaShell’, ‘ltCyan’, ‘forestGreen’, ‘slateGray’, ‘lightGrey’,
‘chartreuse’, ‘aliceBlue’, ‘lime’, ‘mediumTurquoise’, ‘darkMagenta’, ‘medSpringGreen’, ‘yellowGreen’,
‘powderBlue’, ‘turquoise’, ‘white’}
schemeClr
Value must be one of {‘accent3’, ‘phClr’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘bg1’, ‘lt2’, ‘accent2’,
‘accent1’, ‘dk2’, ‘lt1’, ‘accent4’, ‘bg2’, ‘folHlink’, ‘tx1’, ‘tx2’}
scrgbClr
Values must be of type <class ‘openpyxl.drawing.colors.RGBPercent’>
srgbClr
Values must be of type <class ‘str’>
sysClr
Values must be of type <class ‘openpyxl.drawing.colors.SystemColor’>
class openpyxl.drawing.effect.LuminanceEffect(bright=None, contrast=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
bright
Values must be of type <class ‘int’>
contrast
Values must be of type <class ‘int’>
class openpyxl.drawing.effect.OuterShadowEffect(blurRad=None, dist=None, dir=None,
sx=None, sy=None, kx=None, ky=None,
algn=None, rotWithShape=None, **kw)
Bases: openpyxl.drawing.colors.ColorChoice
algn
Value must be one of {‘br’, ‘r’, ‘ctr’, ‘l’, ‘b’, ‘tl’, ‘bl’, ‘tr’, ‘t’}
blurRad
Values must be of type <class ‘float’>
dir
Values must be of type <class ‘int’>
dist
Values must be of type <class ‘float’>
hslClr
Values must be of type <class ‘openpyxl.drawing.colors.HSLColor’>
kx
Values must be of type <class ‘int’>
ky
Values must be of type <class ‘int’>
prstClr
Value must be one of {‘lightSlateGray’, ‘oldLace’, ‘ltPink’, ‘lightSteelBlue’, ‘peachPuff’, ‘steel-
Blue’, ‘dkViolet’, ‘greenYellow’, ‘darkGrey’, ‘moccasin’, ‘snow’, ‘yellow’, ‘firebrick’, ‘medTurquoise’,

136 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

‘gray’, ‘lightSkyBlue’, ‘darkOrchid’, ‘medSeaGreen’, ‘salmon’, ‘mistyRose’, ‘black’, ‘aquamarine’,


‘dkOrange’, ‘mintCream’, ‘red’, ‘magenta’, ‘ltSalmon’, ‘indianRed’, ‘dkGoldenrod’, ‘lightSeaGreen’,
‘paleVioletRed’, ‘royalBlue’, ‘darkSlateBlue’, ‘pink’, ‘crimson’, ‘darkGoldenrod’, ‘darkTurquoise’,
‘dimGray’, ‘tomato’, ‘dkOliveGreen’, ‘springGreen’, ‘dkKhaki’, ‘mediumSlateBlue’, ‘lightBlue’,
‘lavenderBlush’, ‘darkViolet’, ‘lightCyan’, ‘bisque’, ‘lightSlateGrey’, ‘oliveDrab’, ‘peru’, ‘darkBlue’,
‘wheat’, ‘blanchedAlmond’, ‘maroon’, ‘midnightBlue’, ‘darkGray’, ‘grey’, ‘antiqueWhite’, ‘darkOrange’,
‘dkGreen’, ‘goldenrod’, ‘orchid’, ‘navy’, ‘ltGray’, ‘ltSkyBlue’, ‘ltSteelBlue’, ‘medSlateBlue’, ‘nava-
joWhite’, ‘violet’, ‘gold’, ‘dkSlateGrey’, ‘dkTurquoise’, ‘paleGoldenrod’, ‘dkGray’, ‘medPurple’, ‘medi-
umPurple’, ‘darkGreen’, ‘darkSeaGreen’, ‘saddleBrown’, ‘dkRed’, ‘skyBlue’, ‘teal’, ‘ghostWhite’, ‘medi-
umVioletRed’, ‘ltSlateGray’, ‘cornsilk’, ‘seaGreen’, ‘silver’, ‘honeydew’, ‘ltGreen’, ‘dkSeaGreen’, ‘deep-
Pink’, ‘medAquamarine’, ‘dkMagenta’, ‘lightCoral’, ‘medBlue’, ‘medOrchid’, ‘darkSlateGray’, ‘aqua’,
‘beige’, ‘ltSeaGreen’, ‘lemonChiffon’, ‘orange’, ‘whiteSmoke’, ‘blue’, ‘lightGoldenrodYellow’, ‘cyan’,
‘dkCyan’, ‘indigo’, ‘chocolate’, ‘lightSalmon’, ‘coral’, ‘darkSalmon’, ‘dkGrey’, ‘sienna’, ‘dkSalmon’,
‘papayaWhip’, ‘darkCyan’, ‘thistle’, ‘khaki’, ‘lightPink’, ‘dimGrey’, ‘ltGrey’, ‘cornflowerBlue’, ‘ltSlate-
Grey’, ‘purple’, ‘orangeRed’, ‘ivory’, ‘dkOrchid’, ‘floralWhite’, ‘linen’, ‘rosyBrown’, ‘gainsboro’, ‘olive’,
‘hotPink’, ‘lightGreen’, ‘dkBlue’, ‘dodgerBlue’, ‘darkRed’, ‘blueViolet’, ‘darkSlateGrey’, ‘ltGolden-
rodYellow’, ‘mediumOrchid’, ‘burlyWood’, ‘ltYellow’, ‘lawnGreen’, ‘azure’, ‘limeGreen’, ‘lightYel-
low’, ‘dkSlateBlue’, ‘ltBlue’, ‘slateBlue’, ‘mediumAquamarine’, ‘tan’, ‘green’, ‘slateGrey’, ‘lightGray’,
‘medVioletRed’, ‘dkSlateGray’, ‘lavender’, ‘darkKhaki’, ‘cadetBlue’, ‘mediumSeaGreen’, ‘darkOlive-
Green’, ‘paleGreen’, ‘ltCoral’, ‘mediumBlue’, ‘sandyBrown’, ‘paleTurquoise’, ‘mediumSpringGreen’,
‘brown’, ‘fuchsia’, ‘deepSkyBlue’, ‘plum’, ‘seaShell’, ‘ltCyan’, ‘forestGreen’, ‘slateGray’, ‘lightGrey’,
‘chartreuse’, ‘aliceBlue’, ‘lime’, ‘mediumTurquoise’, ‘darkMagenta’, ‘medSpringGreen’, ‘yellowGreen’,
‘powderBlue’, ‘turquoise’, ‘white’}
rotWithShape
Values must be of type <class ‘bool’>
schemeClr
Value must be one of {‘accent3’, ‘phClr’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘bg1’, ‘lt2’, ‘accent2’,
‘accent1’, ‘dk2’, ‘lt1’, ‘accent4’, ‘bg2’, ‘folHlink’, ‘tx1’, ‘tx2’}
scrgbClr
Values must be of type <class ‘openpyxl.drawing.colors.RGBPercent’>
srgbClr
Values must be of type <class ‘str’>
sx
Values must be of type <class ‘int’>
sy
Values must be of type <class ‘int’>
sysClr
Values must be of type <class ‘openpyxl.drawing.colors.SystemColor’>
class openpyxl.drawing.effect.PresetShadowEffect(prst=None, dist=None, dir=None,
**kw)
Bases: openpyxl.drawing.colors.ColorChoice
dir
Values must be of type <class ‘int’>
dist
Values must be of type <class ‘float’>
hslClr
Values must be of type <class ‘openpyxl.drawing.colors.HSLColor’>

9.1. openpyxl package 137


openpyxl Documentation, Release 2.4.0

prst
Value must be one of {‘shdw7’, ‘shdw19’, ‘shdw1’, ‘shdw4’, ‘shdw20’, ‘shdw10’, ‘shdw2’, ‘shdw15’,
‘shdw11’, ‘shdw14’, ‘shdw13’, ‘shdw12’, ‘shdw17’, ‘shdw8’, ‘shdw3’, ‘shdw5’, ‘shdw6’, ‘shdw9’,
‘shdw16’, ‘shdw18’}
prstClr
Value must be one of {‘lightSlateGray’, ‘oldLace’, ‘ltPink’, ‘lightSteelBlue’, ‘peachPuff’, ‘steel-
Blue’, ‘dkViolet’, ‘greenYellow’, ‘darkGrey’, ‘moccasin’, ‘snow’, ‘yellow’, ‘firebrick’, ‘medTurquoise’,
‘gray’, ‘lightSkyBlue’, ‘darkOrchid’, ‘medSeaGreen’, ‘salmon’, ‘mistyRose’, ‘black’, ‘aquamarine’,
‘dkOrange’, ‘mintCream’, ‘red’, ‘magenta’, ‘ltSalmon’, ‘indianRed’, ‘dkGoldenrod’, ‘lightSeaGreen’,
‘paleVioletRed’, ‘royalBlue’, ‘darkSlateBlue’, ‘pink’, ‘crimson’, ‘darkGoldenrod’, ‘darkTurquoise’,
‘dimGray’, ‘tomato’, ‘dkOliveGreen’, ‘springGreen’, ‘dkKhaki’, ‘mediumSlateBlue’, ‘lightBlue’,
‘lavenderBlush’, ‘darkViolet’, ‘lightCyan’, ‘bisque’, ‘lightSlateGrey’, ‘oliveDrab’, ‘peru’, ‘darkBlue’,
‘wheat’, ‘blanchedAlmond’, ‘maroon’, ‘midnightBlue’, ‘darkGray’, ‘grey’, ‘antiqueWhite’, ‘darkOrange’,
‘dkGreen’, ‘goldenrod’, ‘orchid’, ‘navy’, ‘ltGray’, ‘ltSkyBlue’, ‘ltSteelBlue’, ‘medSlateBlue’, ‘nava-
joWhite’, ‘violet’, ‘gold’, ‘dkSlateGrey’, ‘dkTurquoise’, ‘paleGoldenrod’, ‘dkGray’, ‘medPurple’, ‘medi-
umPurple’, ‘darkGreen’, ‘darkSeaGreen’, ‘saddleBrown’, ‘dkRed’, ‘skyBlue’, ‘teal’, ‘ghostWhite’, ‘medi-
umVioletRed’, ‘ltSlateGray’, ‘cornsilk’, ‘seaGreen’, ‘silver’, ‘honeydew’, ‘ltGreen’, ‘dkSeaGreen’, ‘deep-
Pink’, ‘medAquamarine’, ‘dkMagenta’, ‘lightCoral’, ‘medBlue’, ‘medOrchid’, ‘darkSlateGray’, ‘aqua’,
‘beige’, ‘ltSeaGreen’, ‘lemonChiffon’, ‘orange’, ‘whiteSmoke’, ‘blue’, ‘lightGoldenrodYellow’, ‘cyan’,
‘dkCyan’, ‘indigo’, ‘chocolate’, ‘lightSalmon’, ‘coral’, ‘darkSalmon’, ‘dkGrey’, ‘sienna’, ‘dkSalmon’,
‘papayaWhip’, ‘darkCyan’, ‘thistle’, ‘khaki’, ‘lightPink’, ‘dimGrey’, ‘ltGrey’, ‘cornflowerBlue’, ‘ltSlate-
Grey’, ‘purple’, ‘orangeRed’, ‘ivory’, ‘dkOrchid’, ‘floralWhite’, ‘linen’, ‘rosyBrown’, ‘gainsboro’, ‘olive’,
‘hotPink’, ‘lightGreen’, ‘dkBlue’, ‘dodgerBlue’, ‘darkRed’, ‘blueViolet’, ‘darkSlateGrey’, ‘ltGolden-
rodYellow’, ‘mediumOrchid’, ‘burlyWood’, ‘ltYellow’, ‘lawnGreen’, ‘azure’, ‘limeGreen’, ‘lightYel-
low’, ‘dkSlateBlue’, ‘ltBlue’, ‘slateBlue’, ‘mediumAquamarine’, ‘tan’, ‘green’, ‘slateGrey’, ‘lightGray’,
‘medVioletRed’, ‘dkSlateGray’, ‘lavender’, ‘darkKhaki’, ‘cadetBlue’, ‘mediumSeaGreen’, ‘darkOlive-
Green’, ‘paleGreen’, ‘ltCoral’, ‘mediumBlue’, ‘sandyBrown’, ‘paleTurquoise’, ‘mediumSpringGreen’,
‘brown’, ‘fuchsia’, ‘deepSkyBlue’, ‘plum’, ‘seaShell’, ‘ltCyan’, ‘forestGreen’, ‘slateGray’, ‘lightGrey’,
‘chartreuse’, ‘aliceBlue’, ‘lime’, ‘mediumTurquoise’, ‘darkMagenta’, ‘medSpringGreen’, ‘yellowGreen’,
‘powderBlue’, ‘turquoise’, ‘white’}
schemeClr
Value must be one of {‘accent3’, ‘phClr’, ‘accent5’, ‘hlink’, ‘dk1’, ‘accent6’, ‘bg1’, ‘lt2’, ‘accent2’,
‘accent1’, ‘dk2’, ‘lt1’, ‘accent4’, ‘bg2’, ‘folHlink’, ‘tx1’, ‘tx2’}
scrgbClr
Values must be of type <class ‘openpyxl.drawing.colors.RGBPercent’>
srgbClr
Values must be of type <class ‘str’>
sysClr
Values must be of type <class ‘openpyxl.drawing.colors.SystemColor’>
class openpyxl.drawing.effect.ReflectionEffect(blurRad=None, stA=None, stPos=None,
endA=None, endPos=None, dist=None,
dir=None, fadeDir=None, sx=None,
sy=None, kx=None, ky=None, algn=None,
rotWithShape=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
algn
Value must be one of {‘br’, ‘r’, ‘ctr’, ‘l’, ‘b’, ‘tl’, ‘bl’, ‘tr’, ‘t’}
blurRad
Values must be of type <class ‘float’>

138 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

dir
Values must be of type <class ‘int’>
dist
Values must be of type <class ‘float’>
endA
Values must be of type <class ‘int’>
endPos
Values must be of type <class ‘int’>
fadeDir
Values must be of type <class ‘int’>
kx
Values must be of type <class ‘int’>
ky
Values must be of type <class ‘int’>
rotWithShape
Values must be of type <class ‘bool’>
stA
Values must be of type <class ‘int’>
stPos
Values must be of type <class ‘int’>
sx
Values must be of type <class ‘int’>
sy
Values must be of type <class ‘int’>
class openpyxl.drawing.effect.SoftEdgesEffect(rad=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
rad
Values must be of type <class ‘float’>
class openpyxl.drawing.effect.TintEffect(hue=None, amt=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
amt
Values must be of type <class ‘int’>
hue
Values must be of type <class ‘int’>

openpyxl.drawing.fill module
class openpyxl.drawing.fill.Blip(cstate=None, embed=None, link=None, noGrp=None,
noSelect=None, noRot=None, noChangeAspect=None,
noMove=None, noResize=None, noEditPoints=None, noAd-
justHandles=None, noChangeArrowheads=None, noChange-
ShapeType=None, extLst=None, alphaBiLevel=None, al-
phaCeiling=None, alphaFloor=None, alphaInv=None,
alphaMod=None, alphaModFix=None, alphaRepl=None,
biLevel=None, blur=None, clrChange=None, clrRepl=None,
duotone=None, fillOverlay=None, grayscl=None, hsl=None,
lum=None, tint=None)

9.1. openpyxl package 139


openpyxl Documentation, Release 2.4.0

Bases: openpyxl.descriptors.serialisable.Serialisable
alphaBiLevel
Values must be of type <class ‘openpyxl.drawing.effect.AlphaBiLevelEffect’>
alphaCeiling
Values must be of type <class ‘openpyxl.drawing.effect.AlphaCeilingEffect’>
alphaFloor
Values must be of type <class ‘openpyxl.drawing.effect.AlphaFloorEffect’>
alphaInv
Values must be of type <class ‘openpyxl.drawing.effect.AlphaInverseEffect’>
alphaMod
Values must be of type <class ‘openpyxl.drawing.effect.AlphaModulateEffect’>
alphaModFix
Values must be of type <class ‘openpyxl.drawing.effect.AlphaModulateFixedEffect’>
alphaRepl
Values must be of type <class ‘openpyxl.drawing.effect.AlphaReplaceEffect’>
biLevel
Values must be of type <class ‘openpyxl.drawing.effect.BiLevelEffect’>
blur
Values must be of type <class ‘openpyxl.drawing.effect.BlurEffect’>
clrChange
Values must be of type <class ‘openpyxl.drawing.effect.ColorChangeEffect’>
clrRepl
Values must be of type <class ‘openpyxl.drawing.effect.ColorReplaceEffect’>
cstate
Value must be one of {‘print’, ‘screen’, ‘hqprint’, ‘email’}
duotone
Values must be of type <class ‘openpyxl.drawing.effect.DuotoneEffect’>
embed
Values must be of type <class ‘str’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
fillOverlay
Values must be of type <class ‘openpyxl.drawing.effect.FillOverlayEffect’>
grayscl
Values must be of type <class ‘openpyxl.drawing.effect.GrayscaleEffect’>
hsl
Values must be of type <class ‘openpyxl.drawing.effect.HSLEffect’>
link
Values must be of type <class ‘str’>
lum
Values must be of type <class ‘openpyxl.drawing.effect.LuminanceEffect’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’

140 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

noAdjustHandles
Values must be of type <class ‘bool’>
noChangeArrowheads
Values must be of type <class ‘bool’>
noChangeAspect
Values must be of type <class ‘bool’>
noChangeShapeType
Values must be of type <class ‘bool’>
noEditPoints
Values must be of type <class ‘bool’>
noGrp
Values must be of type <class ‘bool’>
noMove
Values must be of type <class ‘bool’>
noResize
Values must be of type <class ‘bool’>
noRot
Values must be of type <class ‘bool’>
noSelect
Values must be of type <class ‘bool’>
tagname = ‘blip’
tint
Values must be of type <class ‘openpyxl.drawing.effect.TintEffect’>
class openpyxl.drawing.fill.BlipFillProperties(dpi=None, rotWithShape=None,
blip=None, tile=None,
stretch=<openpyxl.drawing.fill.StretchInfoProperties
object>, srcRect=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
blip
Values must be of type <class ‘openpyxl.drawing.fill.Blip’>
dpi
Values must be of type <class ‘int’>
rotWithShape
Values must be of type <class ‘bool’>
srcRect
Values must be of type <class ‘openpyxl.drawing.fill.RelativeRect’>
stretch
Values must be of type <class ‘openpyxl.drawing.fill.StretchInfoProperties’>
tagname = ‘blipFill’
tile
Values must be of type <class ‘openpyxl.drawing.fill.TileInfoProperties’>
class openpyxl.drawing.fill.GradientFillProperties(flip=None, rotWithShape=None,
gsLst=None, lin=None, path=None,
tileRect=None)
Bases: openpyxl.descriptors.serialisable.Serialisable

9.1. openpyxl package 141


openpyxl Documentation, Release 2.4.0

flip
Value must be one of {‘y’, ‘xy’, ‘x’}
gsLst
Values must be of type <class ‘openpyxl.drawing.fill.GradientStopList’>
lin
Values must be of type <class ‘openpyxl.drawing.fill.LinearShadeProperties’>
path
Values must be of type <class ‘openpyxl.drawing.fill.PathShadeProperties’>
rotWithShape
Values must be of type <class ‘bool’>
tagname = ‘gradFill’
tileRect
Values must be of type <class ‘openpyxl.drawing.fill.RelativeRect’>
class openpyxl.drawing.fill.GradientStop(pos=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
pos
Values must be of type <class ‘float’>
tagname = ‘gradStop’
class openpyxl.drawing.fill.GradientStopList(gs=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
gs
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘gradStopLst’
class openpyxl.drawing.fill.LinearShadeProperties(ang=None, scaled=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
ang
Values must be of type <class ‘int’>
scaled
Values must be of type <class ‘bool’>
class openpyxl.drawing.fill.PathShadeProperties(path=None, fillToRect=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
fillToRect
Values must be of type <class ‘openpyxl.drawing.fill.RelativeRect’>
path
Value must be one of {‘shape’, ‘rect’, ‘circle’}
class openpyxl.drawing.fill.PatternFillProperties(prst=None, fgClr=None, bg-
Clr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
bgClr
Values must be of type <class ‘openpyxl.drawing.colors.ColorChoice’>
fgClr
Values must be of type <class ‘openpyxl.drawing.colors.ColorChoice’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’

142 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

prst
Value must be one of {‘ltHorz’, ‘trellis’, ‘lgCheck’, ‘pct60’, ‘diagBrick’, ‘dkVert’, ‘pct80’, ‘narVert’,
‘dotDmnd’, ‘weave’, ‘dashVert’, ‘pct50’, ‘plaid’, ‘dashUpDiag’, ‘pct10’, ‘narHorz’, ‘dkDnDiag’, ‘pct20’,
‘wdUpDiag’, ‘solidDmnd’, ‘openDmnd’, ‘pct40’, ‘lgConfetti’, ‘pct5’, ‘dkHorz’, ‘pct70’, ‘smGrid’, ‘dash-
Horz’, ‘wdDnDiag’, ‘smCheck’, ‘pct90’, ‘wave’, ‘divot’, ‘horz’, ‘pct30’, ‘cross’, ‘zigZag’, ‘dashDnDiag’,
‘dotGrid’, ‘sphere’, ‘pct75’, ‘ltUpDiag’, ‘ltVert’, ‘dnDiag’, ‘dkUpDiag’, ‘horzBrick’, ‘ltDnDiag’, ‘sm-
Confetti’, ‘shingle’, ‘upDiag’, ‘lgGrid’, ‘diagCross’, ‘vert’, ‘pct25’}
tagname = ‘pattFill’
class openpyxl.drawing.fill.RelativeRect(l=None, t=None, r=None, b=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
b
Values must be of type <class ‘float’>
l
Values must be of type <class ‘float’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
r
Values must be of type <class ‘float’>
t
Values must be of type <class ‘float’>
tagname = ‘rect’
class openpyxl.drawing.fill.StretchInfoProperties(fillRect=<openpyxl.drawing.fill.RelativeRect
object>)
Bases: openpyxl.descriptors.serialisable.Serialisable
fillRect
Values must be of type <class ‘openpyxl.drawing.fill.RelativeRect’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
tagname = ‘stretch’
class openpyxl.drawing.fill.TileInfoProperties(tx=None, ty=None, sx=None, sy=None,
flip=None, algn=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
algn
Value must be one of {‘br’, ‘r’, ‘ctr’, ‘l’, ‘b’, ‘tl’, ‘bl’, ‘tr’, ‘t’}
flip
Value must be one of {‘y’, ‘xy’, ‘x’}
sx
Values must be of type <class ‘int’>
sy
Values must be of type <class ‘int’>
tx
Values must be of type <class ‘int’>
ty
Values must be of type <class ‘int’>

9.1. openpyxl package 143


openpyxl Documentation, Release 2.4.0

openpyxl.drawing.graphic module
class openpyxl.drawing.graphic.ChartRelation(id)
Bases: openpyxl.descriptors.serialisable.Serialisable
id
Values must be of type <class ‘str’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/chart’
tagname = ‘chart’
class openpyxl.drawing.graphic.Connection(id=None, idx=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
id
Values must be of type <class ‘int’>
idx
Values must be of type <class ‘int’>
class openpyxl.drawing.graphic.Connector(macro=None, fPublished=None, nvCxnSpPr=None,
spPr=None, style=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
fPublished
Values must be of type <class ‘bool’>
macro
Values must be of type <class ‘str’>
nvCxnSpPr
Values must be of type <class ‘openpyxl.drawing.graphic.ConnectorNonVisual’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
style
Values must be of type <class ‘openpyxl.drawing.shapes.ShapeStyle’>
class openpyxl.drawing.graphic.ConnectorLocking(extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
class openpyxl.drawing.graphic.ConnectorNonVisual(cNvPr=None, cNvCxnSpPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cNvCxnSpPr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualConnectorProperties’>
cNvPr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualDrawingProps’>
class openpyxl.drawing.graphic.GraphicData(uri=’http://schemas.openxmlformats.org/drawingml/2006/chart’,
chart=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
chart
Values must be of type <class ‘openpyxl.drawing.graphic.ChartRelation’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
tagname = ‘graphicData’

144 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

uri
Values must be of type <class ‘str’>
class openpyxl.drawing.graphic.GraphicFrame(nvGraphicFramePr=None, xfrm=None,
graphic=None, macro=None, fPub-
lished=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
fPublished
Values must be of type <class ‘bool’>
graphic
Values must be of type <class ‘openpyxl.drawing.graphic.GraphicObject’>
macro
Values must be of type <class ‘str’>
nvGraphicFramePr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualGraphicFrame’>
tagname = ‘graphicFrame’
xfrm
Values must be of type <class ‘openpyxl.drawing.shapes.Transform2D’>
class openpyxl.drawing.graphic.GraphicFrameLocking(noGrp=None, noDrilldown=None,
noSelect=None, noChangeA-
spect=None, noMove=None, noRe-
size=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
noChangeAspect
Values must be of type <class ‘bool’>
noDrilldown
Values must be of type <class ‘bool’>
noGrp
Values must be of type <class ‘bool’>
noMove
Values must be of type <class ‘bool’>
noResize
Values must be of type <class ‘bool’>
noSelect
Values must be of type <class ‘bool’>
class openpyxl.drawing.graphic.GraphicObject(graphicData=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
graphicData
Values must be of type <class ‘openpyxl.drawing.graphic.GraphicData’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
tagname = ‘graphic’

9.1. openpyxl package 145


openpyxl Documentation, Release 2.4.0

class openpyxl.drawing.graphic.GroupLocking(noGrp=None, noUngrp=None, noSelect=None,


noRot=None, noChangeAspect=None,
noMove=None, noResize=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
noChangeAspect
Values must be of type <class ‘bool’>
noGrp
Values must be of type <class ‘bool’>
noMove
Values must be of type <class ‘bool’>
noResize
Values must be of type <class ‘bool’>
noRot
Values must be of type <class ‘bool’>
noSelect
Values must be of type <class ‘bool’>
noUngrp
Values must be of type <class ‘bool’>
class openpyxl.drawing.graphic.GroupShape(nvGrpSpPr=None, grpSpPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
grpSpPr
Values must be of type <class ‘openpyxl.drawing.graphic.GroupShapeProperties’>
nvGrpSpPr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualGroupShape’>
class openpyxl.drawing.graphic.GroupShapeProperties(bwMode=None, xfrm=None,
scene3d=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
bwMode
Value must be one of {‘gray’, ‘blackWhite’, ‘hidden’, ‘auto’, ‘grayWhite’, ‘ltGray’, ‘white’, ‘clr’, ‘in-
vGray’, ‘blackGray’, ‘black’}
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
scene3d
Values must be of type <class ‘openpyxl.drawing.shapes.Scene3D’>
xfrm
Values must be of type <class ‘openpyxl.drawing.graphic.GroupTransform2D’>
class openpyxl.drawing.graphic.GroupTransform2D(rot=None, flipH=None, flipV=None,
off=None, ext=None, chOff=None,
chExt=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
chExt
Values must be of type <class ‘openpyxl.drawing.shapes.PositiveSize2D’>

146 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

chOff
Values must be of type <class ‘openpyxl.drawing.shapes.Point2D’>
ext
Values must be of type <class ‘openpyxl.drawing.shapes.PositiveSize2D’>
flipH
Values must be of type <class ‘bool’>
flipV
Values must be of type <class ‘bool’>
off
Values must be of type <class ‘openpyxl.drawing.shapes.Point2D’>
rot
Values must be of type <class ‘int’>
class openpyxl.drawing.graphic.NonVisualConnectorProperties(cxnSpLocks=None,
stCxn=None,
endCxn=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cxnSpLocks
Values must be of type <class ‘openpyxl.drawing.graphic.ConnectorLocking’>
endCxn
Values must be of type <class ‘openpyxl.drawing.graphic.Connection’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
stCxn
Values must be of type <class ‘openpyxl.drawing.graphic.Connection’>
class openpyxl.drawing.graphic.NonVisualDrawingProps(id=None, name=None, de-
scr=None, hidden=None, ti-
tle=None, hlinkClick=None,
hlinkHover=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
descr
Values must be of type <class ‘str’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
hidden
Values must be of type <class ‘bool’>
hlinkClick
Values must be of type <class ‘openpyxl.drawing.text.Hyperlink’>
hlinkHover
Values must be of type <class ‘openpyxl.drawing.text.Hyperlink’>
id
Values must be of type <class ‘int’>
name
Values must be of type <class ‘str’>
tagname = ‘cNvPr’

9.1. openpyxl package 147


openpyxl Documentation, Release 2.4.0

title
Values must be of type <class ‘str’>
class openpyxl.drawing.graphic.NonVisualGraphicFrame(cNvPr=None, cNvGraph-
icFramePr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cNvGraphicFramePr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualGraphicFrameProperties’>
cNvPr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualDrawingProps’>
tagname = ‘nvGraphicFramePr’
class openpyxl.drawing.graphic.NonVisualGraphicFrameProperties(graphicFrameLocks=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
graphicFrameLocks
Values must be of type <class ‘openpyxl.drawing.graphic.GraphicFrameLocking’>
tagname = ‘cNvGraphicFramePr’
class openpyxl.drawing.graphic.NonVisualGroupDrawingShapeProps(grpSpLocks=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
grpSpLocks
Values must be of type <class ‘openpyxl.drawing.graphic.GroupLocking’>
class openpyxl.drawing.graphic.NonVisualGroupShape(cNvPr=None, cNvGrpSpPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cNvGrpSpPr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualGroupDrawingShapeProps’>
cNvPr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualDrawingProps’>
class openpyxl.drawing.graphic.NonVisualPictureProperties(preferRelativeResize=None,
picLocks=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
picLocks
Values must be of type <class ‘openpyxl.drawing.graphic.PictureLocking’>
preferRelativeResize
Values must be of type <class ‘bool’>
tagname = ‘cNvPicPr’

148 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.drawing.graphic.PictureFrame(macro=None, fPublished=None,


nvPicPr=None, blipFill=None, spPr=None,
style=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
blipFill
Values must be of type <class ‘openpyxl.drawing.fill.BlipFillProperties’>
fPublished
Values must be of type <class ‘bool’>
macro
Values must be of type <class ‘str’>
nvPicPr
Values must be of type <class ‘openpyxl.drawing.graphic.PictureNonVisual’>
spPr
Values must be of type <class ‘openpyxl.chart.shapes.GraphicalProperties’>
style
Values must be of type <class ‘openpyxl.drawing.shapes.ShapeStyle’>
tagname = ‘pic’
class openpyxl.drawing.graphic.PictureLocking(noCrop=None, noGrp=None, noSe-
lect=None, noRot=None, noChangeA-
spect=None, noMove=None, noRe-
size=None, noEditPoints=None, noAd-
justHandles=None, noChangeArrow-
heads=None, noChangeShapeType=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
noAdjustHandles
Values must be of type <class ‘bool’>
noChangeArrowheads
Values must be of type <class ‘bool’>
noChangeAspect
Values must be of type <class ‘bool’>
noChangeShapeType
Values must be of type <class ‘bool’>
noCrop
Values must be of type <class ‘bool’>
noEditPoints
Values must be of type <class ‘bool’>
noGrp
Values must be of type <class ‘bool’>
noMove
Values must be of type <class ‘bool’>

9.1. openpyxl package 149


openpyxl Documentation, Release 2.4.0

noResize
Values must be of type <class ‘bool’>
noRot
Values must be of type <class ‘bool’>
noSelect
Values must be of type <class ‘bool’>
tagname = ‘picLocks’
class openpyxl.drawing.graphic.PictureNonVisual(cNvPr=None, cNvPicPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cNvPicPr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualPictureProperties’>
cNvPr
Values must be of type <class ‘openpyxl.drawing.graphic.NonVisualDrawingProps’>
tagname = ‘nvPicPr’

openpyxl.drawing.image module
class openpyxl.drawing.image.Image(img, coordinates=((0, 0), (1, 1)), size=(None, None),
nochangeaspect=True, nochangearrowheads=True)
Bases: object
Raw Image class
anchor(cell, anchortype=’absolute’)
anchors the image to the given cell optional parameter anchortype supports ‘absolute’ or ‘oneCell’
openpyxl.drawing.image.bounding_box(bw, bh, w, h)
Returns a tuple (new_width, new_height) which has the property that it fits within box_width and box_height
and has (close to) the same aspect ratio as the original size

openpyxl.drawing.line module
class openpyxl.drawing.line.DashStop(d=0, sp=0)
Bases: openpyxl.descriptors.serialisable.Serialisable
d
Values must be of type <class ‘int’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
sp
Values must be of type <class ‘int’>
tagname = ‘ds’
class openpyxl.drawing.line.DashStopList(ds=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
ds
A sequence (list or tuple) that may only contain objects of the declared type
class openpyxl.drawing.line.LineEndProperties(type=None, w=None, len=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
len
Value must be one of {‘lg’, ‘med’, ‘sm’}
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’

150 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

tagname = ‘end’
type
Value must be one of {‘stealth’, ‘arrow’, ‘none’, ‘diamond’, ‘triangle’, ‘oval’}
w
Value must be one of {‘lg’, ‘med’, ‘sm’}
class openpyxl.drawing.line.LineJoinMiterProperties(lim=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
lim
Values must be of type <class ‘int’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
tagname = ‘miter’
class openpyxl.drawing.line.LineProperties(w=None, cap=None, cmpd=None, algn=None,
noFill=None, solidFill=None, gradFill=None,
pattFill=None, prstDash=None, custDash=None,
round=None, bevel=None, mitre=None, head-
End=None, tailEnd=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
algn
Value must be one of {‘in’, ‘ctr’}
bevel
Values must be of type <class ‘bool’>
cap
Value must be one of {‘sq’, ‘flat’, ‘rnd’}
cmpd
Value must be one of {‘thickThin’, ‘tri’, ‘thinThick’, ‘sng’, ‘dbl’}
custDash
Values must be of type <class ‘openpyxl.drawing.line.DashStop’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
gradFill
Values must be of type <class ‘openpyxl.drawing.fill.GradientFillProperties’>
headEnd
Values must be of type <class ‘openpyxl.drawing.line.LineEndProperties’>
miter
Values must be of type <class ‘openpyxl.drawing.line.LineJoinMiterProperties’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
noFill
Values must be of type <class ‘bool’>
pattFill
Values must be of type <class ‘openpyxl.drawing.fill.PatternFillProperties’>
prstDash
Value must be one of {‘solid’, ‘sysDashDot’, ‘lgDash’, ‘lgDashDot’, ‘lgDashDotDot’, ‘sysDashDotDot’,
‘sysDash’, ‘dashDot’, ‘dash’, ‘sysDot’, ‘dot’}

9.1. openpyxl package 151


openpyxl Documentation, Release 2.4.0

round
Values must be of type <class ‘bool’>
solidFill
Values must be of type <class ‘openpyxl.drawing.colors.ColorChoice’>
tagname = ‘ln’
tailEnd
Values must be of type <class ‘openpyxl.drawing.line.LineEndProperties’>
w
Values must be of type <class ‘float’>

openpyxl.drawing.shape module
class openpyxl.drawing.shape.Shape(chart, coordinates=((0, 0), (1, 1)), text=None,
scheme=’accent1’)
Bases: object
a drawing inside a chart coordiantes are specified by the user in the axis units
FONT_HEIGHT = 8
FONT_WIDTH = 7
MARGIN_BOTTOM = 28
MARGIN_LEFT = 20
RECT = ‘rect’
“line” “lineInv” “triangle” “rtTriangle” “diamond” “parallelogram” “trapezoid” “nonIsoscelesTrapezoid”
“pentagon” “hexagon” “heptagon” “octagon” “decagon” “dodecagon” “star4” “star5” “star6” “star7”
“star8” “star10” “star12” “star16” “star24” “star32” “roundRect” “round1Rect” “round2SameRect”
“round2DiagRect” “snipRoundRect” “snip1Rect” “snip2SameRect” “snip2DiagRect” “plaque” “ellipse”
“teardrop” “homePlate” “chevron” “pieWedge” “pie” “blockArc” “donut” “noSmoking” “rightAr-
row” “leftArrow” “upArrow” “downArrow” “stripedRightArrow” “notchedRightArrow” “bentUpAr-
row” “leftRightArrow” “upDownArrow” “leftUpArrow” “leftRightUpArrow” “quadArrow” “leftArrow-
Callout” “rightArrowCallout” “upArrowCallout” “downArrowCallout” “leftRightArrowCallout” “up-
DownArrowCallout” “quadArrowCallout” “bentArrow” “uturnArrow” “circularArrow” “leftCircularAr-
row” “leftRightCircularArrow” “curvedRightArrow” “curvedLeftArrow” “curvedUpArrow” “curved-
DownArrow” “swooshArrow” “cube” “can” “lightningBolt” “heart” “sun” “moon” “smileyFace” “ir-
regularSeal1” “irregularSeal2” “foldedCorner” “bevel” “frame” “halfFrame” “corner” “diagStripe”
“chord” “arc” “leftBracket” “rightBracket” “leftBrace” “rightBrace” “bracketPair” “bracePair” “straight-
Connector1” “bentConnector2” “bentConnector3” “bentConnector4” “bentConnector5” “curvedCon-
nector2” “curvedConnector3” “curvedConnector4” “curvedConnector5” “callout1” “callout2” “call-
out3” “accentCallout1” “accentCallout2” “accentCallout3” “borderCallout1” “borderCallout2” “bor-
derCallout3” “accentBorderCallout1” “accentBorderCallout2” “accentBorderCallout3” “wedgeRectCall-
out” “wedgeRoundRectCallout” “wedgeEllipseCallout” “cloudCallout” “cloud” “ribbon” “ribbon2” “el-
lipseRibbon” “ellipseRibbon2” “leftRightRibbon” “verticalScroll” “horizontalScroll” “wave” “double-
Wave” “plus” “flowChartProcess” “flowChartDecision” “flowChartInputOutput” “flowChartPredefined-
Process” “flowChartInternalStorage” “flowChartDocument” “flowChartMultidocument” “flowChartTer-
minator” “flowChartPreparation” “flowChartManualInput” “flowChartManualOperation” “flowChartCon-
nector” “flowChartPunchedCard” “flowChartPunchedTape” “flowChartSummingJunction” “flowChar-
tOr” “flowChartCollate” “flowChartSort” “flowChartExtract” “flowChartMerge” “flowChartOfflineStor-
age” “flowChartOnlineStorage” “flowChartMagneticTape” “flowChartMagneticDisk” “flowChartMag-
neticDrum” “flowChartDisplay” “flowChartDelay” “flowChartAlternateProcess” “flowChartOffpageCon-
nector” “actionButtonBlank” “actionButtonHome” “actionButtonHelp” “actionButtonInformation” “ac-
tionButtonForwardNext” “actionButtonBackPrevious” “actionButtonEnd” “actionButtonBeginning” “ac-
tionButtonReturn” “actionButtonDocument” “actionButtonSound” “actionButtonMovie” “gear6” “gear9”

152 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

“funnel” “mathPlus” “mathMinus” “mathMultiply” “mathDivide” “mathEqual” “mathNotEqual” “cor-


nerTabs” “squareTabs” “plaqueTabs” “chartX” “chartStar” “chartPlus”
ROUND_RECT = ‘roundRect’
border_color
border_width
color
coordinates
Return coordindates in axis units
text_color
class openpyxl.drawing.shape.ShapeWriter(shapes)
Bases: object
one file per shape
write(shape_id)

openpyxl.drawing.shapes module
class openpyxl.drawing.shapes.AdjPoint2D(x=None, y=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
x
Values must be of type <class ‘int’>
y
Values must be of type <class ‘int’>
class openpyxl.drawing.shapes.AdjustHandleList
Bases: openpyxl.descriptors.serialisable.Serialisable
class openpyxl.drawing.shapes.Backdrop(anchor=None, norm=None, up=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
anchor
Values must be of type <class ‘openpyxl.drawing.shapes.Point3D’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
norm
Values must be of type <class ‘openpyxl.drawing.shapes.Vector3D’>
up
Values must be of type <class ‘openpyxl.drawing.shapes.Vector3D’>
class openpyxl.drawing.shapes.Bevel(w=None, h=None, prst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
h
Values must be of type Values must be of type <class ‘int’>
prst
Values must be of type <openpyxl.descriptors.base.Set object at 0x7fd32b6e5898>
w
Values must be of type Values must be of type <class ‘int’>
class openpyxl.drawing.shapes.Camera(prst=None, fov=None, zoom=None, rot=None)
Bases: openpyxl.descriptors.serialisable.Serialisable

9.1. openpyxl package 153


openpyxl Documentation, Release 2.4.0

fov
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
prst
Values must be of type <openpyxl.descriptors.base.Set object at 0x7fd32b6e5080>
rot
Values must be of type <class ‘openpyxl.drawing.shapes.SphereCoords’>
zoom
Values must be of type <class ‘openpyxl.descriptors.excel.Percentage’>
class openpyxl.drawing.shapes.ConnectionSite(ang=None, pos=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
ang
Values must be of type <class ‘float’>
pos
Values must be of type <class ‘openpyxl.drawing.shapes.AdjPoint2D’>
class openpyxl.drawing.shapes.ConnectionSiteList(cxn=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cxn
Values must be of type <class ‘openpyxl.drawing.shapes.ConnectionSite’>
class openpyxl.drawing.shapes.CustomGeometry2D(avLst=None, gdLst=None, ahLst=None,
cxnLst=None, rect=None, pathLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
ahLst
Values must be of type <class ‘openpyxl.drawing.shapes.AdjustHandleList’>
avLst
Values must be of type <class ‘openpyxl.drawing.shapes.GeomGuideList’>
cxnLst
Values must be of type <class ‘openpyxl.drawing.shapes.ConnectionSiteList’>
gdLst
Values must be of type <class ‘openpyxl.drawing.shapes.GeomGuideList’>
pathLst
Values must be of type <class ‘openpyxl.drawing.shapes.Path2DList’>
rect
Values must be of type <class ‘openpyxl.drawing.shapes.GeomRect’>
class openpyxl.drawing.shapes.FontReference(idx=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
idx
Value must be one of {‘minor’, ‘major’}
class openpyxl.drawing.shapes.GeomGuide(name=None, fmla=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
fmla
Values must be of type <class ‘str’>
name
Values must be of type <class ‘str’>

154 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.drawing.shapes.GeomGuideList(gd=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
gd
Values must be of type <class ‘openpyxl.drawing.shapes.GeomGuide’>
class openpyxl.drawing.shapes.GeomRect(l=None, t=None, r=None, b=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
b
Values must be of type <class ‘int’>
l
Values must be of type <class ‘int’>
r
Values must be of type <class ‘int’>
t
Values must be of type <class ‘int’>
class openpyxl.drawing.shapes.LightRig(rig=None, dir=None, rot=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
dir
Values must be of type <openpyxl.descriptors.base.Set object at 0x7fd32b6e52b0>
rig
Values must be of type <openpyxl.descriptors.base.Set object at 0x7fd32b6e51d0>
rot
Values must be of type <class ‘openpyxl.drawing.shapes.SphereCoords’>
class openpyxl.drawing.shapes.Path2D(w=None, h=None, fill=None, stroke=None, extru-
sionOk=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extrusionOk
Values must be of type <class ‘bool’>
fill
Value must be one of {‘darkenLess’, ‘norm’, ‘lightenLess’, ‘lighten’, ‘darken’}
h
Values must be of type <class ‘float’>
stroke
Values must be of type <class ‘bool’>
w
Values must be of type <class ‘float’>
class openpyxl.drawing.shapes.Path2DList(path=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
path
Values must be of type <class ‘openpyxl.drawing.shapes.Path2D’>
class openpyxl.drawing.shapes.Point2D(x=None, y=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
x
Values must be of type <class ‘int’>

9.1. openpyxl package 155


openpyxl Documentation, Release 2.4.0

y
Values must be of type <class ‘int’>
class openpyxl.drawing.shapes.Point3D(x=None, y=None, z=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
x
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
y
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
z
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
class openpyxl.drawing.shapes.PositiveSize2D(cx=None, cy=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
Dimensions in EMUs
cx
Values must be of type <class ‘int’>
cy
Values must be of type <class ‘int’>
class openpyxl.drawing.shapes.PresetGeometry2D(prst=None, avLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
avLst
Values must be of type <class ‘openpyxl.drawing.shapes.GeomGuideList’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
prst
Value must be one of {‘flowChartOnlineStorage’, ‘gear6’, ‘bentUpArrow’, ‘bentConnector3’, ‘home-
Plate’, ‘callout2’, ‘flowChartManualOperation’, ‘borderCallout3’, ‘actionButtonBackPrevious’, ‘star8’,
‘round2SameRect’, ‘accentCallout3’, ‘leftUpArrow’, ‘decagon’, ‘corner’, ‘flowChartInputOutput’,
‘mathNotEqual’, ‘diamond’, ‘borderCallout1’, ‘actionButtonMovie’, ‘horizontalScroll’, ‘flowChart-
ManualInput’, ‘leftArrowCallout’, ‘callout3’, ‘star5’, ‘accentCallout1’, ‘star10’, ‘flowChartMagnetic-
Drum’, ‘actionButtonReturn’, ‘actionButtonSound’, ‘flowChartMultidocument’, ‘actionButtonHome’,
‘actionButtonEnd’, ‘mathEqual’, ‘stripedRightArrow’, ‘callout1’, ‘mathMultiply’, ‘flowChartInternal-
Storage’, ‘flowChartPunchedCard’, ‘ribbon2’, ‘actionButtonBlank’, ‘quadArrowCallout’, ‘bracePair’,
‘flowChartOfflineStorage’, ‘blockArc’, ‘curvedUpArrow’, ‘foldedCorner’, ‘heptagon’, ‘uturnArrow’,
‘hexagon’, ‘roundRect’, ‘flowChartPreparation’, ‘trapezoid’, ‘flowChartMagneticTape’, ‘donut’, ‘light-
ningBolt’, ‘star4’, ‘ellipseRibbon’, ‘irregularSeal1’, ‘octagon’, ‘triangle’, ‘doubleWave’, ‘noSmoking’,
‘mathPlus’, ‘wedgeRectCallout’, ‘accentBorderCallout2’, ‘upArrowCallout’, ‘pentagon’, ‘plaque’, ‘el-
lipse’, ‘borderCallout2’, ‘cornerTabs’, ‘pie’, ‘quadArrow’, ‘flowChartDocument’, ‘notchedRightArrow’,
‘teardrop’, ‘snip2DiagRect’, ‘star6’, ‘actionButtonBeginning’, ‘leftRightArrow’, ‘curvedRightArrow’,
‘accentCallout2’, ‘leftRightCircularArrow’, ‘leftRightUpArrow’, ‘round2DiagRect’, ‘moon’, ‘action-
ButtonDocument’, ‘parallelogram’, ‘cloudCallout’, ‘flowChartExtract’, ‘curvedConnector3’, ‘flowChart-
MagneticDisk’, ‘lineInv’, ‘irregularSeal2’, ‘curvedConnector4’, ‘line’, ‘flowChartSort’, ‘leftRightRib-
bon’, ‘diagStripe’, ‘rtTriangle’, ‘rect’, ‘star12’, ‘star16’, ‘flowChartOffpageConnector’, ‘chord’, ‘half-
Frame’, ‘wedgeRoundRectCallout’, ‘squareTabs’, ‘rightArrowCallout’, ‘gear9’, ‘upDownArrowCallout’,
‘ellipseRibbon2’, ‘snip2SameRect’, ‘flowChartPunchedTape’, ‘actionButtonInformation’, ‘flowChart-
Process’, ‘accentBorderCallout3’, ‘flowChartCollate’, ‘upDownArrow’, ‘rightArrow’, ‘circularArrow’,
‘flowChartMerge’, ‘bevel’, ‘wave’, ‘flowChartAlternateProcess’, ‘smileyFace’, ‘flowChartConnector’,
‘flowChartPredefinedProcess’, ‘curvedConnector5’, ‘bentArrow’, ‘curvedConnector2’, ‘can’, ‘flowChart-
Display’, ‘mathMinus’, ‘nonIsoscelesTrapezoid’, ‘mathDivide’, ‘arc’, ‘bentConnector4’, ‘snip1Rect’,

156 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

‘downArrow’, ‘star7’, ‘rightBrace’, ‘accentBorderCallout1’, ‘rightBracket’, ‘flowChartDelay’, ‘left-


Bracket’, ‘chartX’, ‘bentConnector5’, ‘actionButtonForwardNext’, ‘cube’, ‘curvedLeftArrow’, ‘sun’, ‘lef-
tArrow’, ‘straightConnector1’, ‘leftCircularArrow’, ‘frame’, ‘chartPlus’, ‘dodecagon’, ‘flowChartDeci-
sion’, ‘actionButtonHelp’, ‘snipRoundRect’, ‘star24’, ‘flowChartOr’, ‘funnel’, ‘curvedDownArrow’, ‘left-
RightArrowCallout’, ‘swooshArrow’, ‘pieWedge’, ‘leftBrace’, ‘plaqueTabs’, ‘round1Rect’, ‘heart’, ‘plus’,
‘chevron’, ‘flowChartTerminator’, ‘chartStar’, ‘downArrowCallout’, ‘bracketPair’, ‘upArrow’, ‘verti-
calScroll’, ‘flowChartSummingJunction’, ‘star32’, ‘wedgeEllipseCallout’, ‘bentConnector2’, ‘cloud’,
‘ribbon’}
class openpyxl.drawing.shapes.Scene3D(camera=None, lightRig=None, backdrop=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
backdrop
Values must be of type <class ‘openpyxl.drawing.shapes.Backdrop’>
camera
Values must be of type <class ‘openpyxl.drawing.shapes.Camera’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
lightRig
Values must be of type <class ‘openpyxl.drawing.shapes.LightRig’>
class openpyxl.drawing.shapes.Shape3D(z=None, extrusionH=None, contourW=None, prstMa-
terial=None, bevelT=None, bevelB=None, extrusion-
Clr=None, contourClr=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
bevelB
Values must be of type <class ‘openpyxl.drawing.shapes.Bevel’>
bevelT
Values must be of type <class ‘openpyxl.drawing.shapes.Bevel’>
contourClr
Values must be of type <class ‘openpyxl.styles.colors.Color’>
contourW
Values must be of type Values must be of type <class ‘int’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
extrusionClr
Values must be of type <class ‘openpyxl.styles.colors.Color’>
extrusionH
Values must be of type Values must be of type <class ‘int’>
prstMaterial
Values must be of type <openpyxl.descriptors.base.Set object at 0x7fd32b6e5a58>
z
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
class openpyxl.drawing.shapes.ShapeStyle(lnRef=None, fillRef=None, effectRef=None,
fontRef=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
effectRef
Values must be of type <class ‘openpyxl.drawing.shapes.StyleMatrixReference’>

9.1. openpyxl package 157


openpyxl Documentation, Release 2.4.0

fillRef
Values must be of type <class ‘openpyxl.drawing.shapes.StyleMatrixReference’>
fontRef
Values must be of type <class ‘openpyxl.drawing.shapes.FontReference’>
lnRef
Values must be of type <class ‘openpyxl.drawing.shapes.StyleMatrixReference’>
class openpyxl.drawing.shapes.SphereCoords(lat=None, lon=None, rev=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
lat
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
lon
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
rev
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
class openpyxl.drawing.shapes.StyleMatrixReference(idx=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
idx
Values must be of type <class ‘int’>
class openpyxl.drawing.shapes.Transform2D(rot=None, flipH=None, flipV=None, off=None,
ext=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
ext
Values must be of type <class ‘openpyxl.drawing.shapes.PositiveSize2D’>
flipH
Values must be of type <class ‘bool’>
flipV
Values must be of type <class ‘bool’>
off
Values must be of type <class ‘openpyxl.drawing.shapes.Point2D’>
rot
Values must be of type <class ‘int’>
tagname = ‘xfrm’
class openpyxl.drawing.shapes.Vector3D(dx=None, dy=None, dz=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
dx
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
dy
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
dz
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>

openpyxl.drawing.spreadsheet_drawing module

158 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor(pos=None, ext=None,


**kw)
Bases: openpyxl.drawing.spreadsheet_drawing._AnchorBase
clientData
Values must be of type <class ‘openpyxl.drawing.spreadsheet_drawing.AnchorClientData’>
contentPart
Values must be of type <class ‘str’>
cxnSp
Values must be of type <class ‘openpyxl.drawing.graphic.Connector’>
ext
Values must be of type <class ‘openpyxl.drawing.shapes.PositiveSize2D’>
graphicFrame
Values must be of type <class ‘openpyxl.drawing.graphic.GraphicFrame’>
grpSp
Values must be of type <class ‘openpyxl.drawing.graphic.GroupShape’>
pic
Values must be of type <class ‘openpyxl.drawing.graphic.PictureFrame’>
pos
Values must be of type <class ‘openpyxl.drawing.shapes.Point2D’>
sp
Value must be one of {‘coneToMax’, ‘pyramid’, ‘pyramidToMax’, ‘cylinder’, ‘box’, ‘cone’}
tagname = ‘absoluteAnchor’
class openpyxl.drawing.spreadsheet_drawing.AnchorClientData(fLocksWithSheet=None,
fPrintsWithSheet=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
fLocksWithSheet
Values must be of type <class ‘bool’>
fPrintsWithSheet
Values must be of type <class ‘bool’>
class openpyxl.drawing.spreadsheet_drawing.AnchorMarker(col=0, colOff=0, row=0,
rowOff=0)
Bases: openpyxl.descriptors.serialisable.Serialisable
col
Values must be of type <class ‘int’>
colOff
Values must be of type <class ‘int’>
row
Values must be of type <class ‘int’>
rowOff
Values must be of type <class ‘int’>
tagname = ‘marker’
class openpyxl.drawing.spreadsheet_drawing.OneCellAnchor(_from=None, ext=None,
**kw)
Bases: openpyxl.drawing.spreadsheet_drawing._AnchorBase

9.1. openpyxl package 159


openpyxl Documentation, Release 2.4.0

clientData
Values must be of type <class ‘openpyxl.drawing.spreadsheet_drawing.AnchorClientData’>
contentPart
Values must be of type <class ‘str’>
cxnSp
Values must be of type <class ‘openpyxl.drawing.graphic.Connector’>
ext
Values must be of type <class ‘openpyxl.drawing.shapes.PositiveSize2D’>
graphicFrame
Values must be of type <class ‘openpyxl.drawing.graphic.GraphicFrame’>
grpSp
Values must be of type <class ‘openpyxl.drawing.graphic.GroupShape’>
pic
Values must be of type <class ‘openpyxl.drawing.graphic.PictureFrame’>
sp
Value must be one of {‘coneToMax’, ‘pyramid’, ‘pyramidToMax’, ‘cylinder’, ‘box’, ‘cone’}
tagname = ‘oneCellAnchor’
class openpyxl.drawing.spreadsheet_drawing.SpreadsheetDrawing(twoCellAnchor=(),
oneCellAnchor=(),
absoluteAnchor=())
Bases: openpyxl.descriptors.serialisable.Serialisable
absoluteAnchor
A sequence (list or tuple) that may only contain objects of the declared type
oneCellAnchor
A sequence (list or tuple) that may only contain objects of the declared type
tagname = ‘wsDr’
twoCellAnchor
A sequence (list or tuple) that may only contain objects of the declared type
class openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor(editAs=None, _from=None,
to=None, **kw)
Bases: openpyxl.drawing.spreadsheet_drawing._AnchorBase
clientData
Values must be of type <class ‘openpyxl.drawing.spreadsheet_drawing.AnchorClientData’>
contentPart
Values must be of type <class ‘str’>
cxnSp
Values must be of type <class ‘openpyxl.drawing.graphic.Connector’>
editAs
Value must be one of {‘oneCell’, ‘twoCell’, ‘absolute’}
graphicFrame
Values must be of type <class ‘openpyxl.drawing.graphic.GraphicFrame’>
grpSp
Values must be of type <class ‘openpyxl.drawing.graphic.GroupShape’>

160 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

pic
Values must be of type <class ‘openpyxl.drawing.graphic.PictureFrame’>
sp
Value must be one of {‘coneToMax’, ‘pyramid’, ‘pyramidToMax’, ‘cylinder’, ‘box’, ‘cone’}
tagname = ‘twoCellAnchor’
to
Values must be of type <class ‘openpyxl.drawing.spreadsheet_drawing.AnchorMarker’>

openpyxl.drawing.text module
class openpyxl.drawing.text.AutonumberBullet(type=None, startAt=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
startAt
Values must be of type <class ‘int’>
type
Value must be one of {‘arabicDbPlain’, ‘hindiAlpha1Period’, ‘ea1JpnKorPeriod’, ‘ea1ChsPlain’, ‘cir-
cleNumWdWhitePlain’, ‘thaiAlphaParenR’, ‘circleNumWdBlackPlain’, ‘ea1ChtPlain’, ‘thaiAlphaParen-
Both’, ‘alphaUcParenR’, ‘hebrew2Minus’, ‘romanUcPeriod’, ‘arabicDbPeriod’, ‘hindiAlphaPeriod’, ‘ara-
bicPlain’, ‘circleNumDbPlain’, ‘ea1JpnChsDbPeriod’, ‘thaiNumParenBoth’, ‘arabic2Minus’, ‘thaiAl-
phaPeriod’, ‘romanLcPeriod’, ‘arabicParenR’, ‘alphaLcParenR’, ‘romanUcParenR’, ‘ea1ChsPeriod’, ‘ara-
bicParenBoth’, ‘alphaLcPeriod’, ‘romanLcParenR’, ‘alphaUcParenBoth’, ‘ea1ChtPeriod’, ‘thaiNum-
ParenR’, ‘romanLcParenBoth’, ‘arabic1Minus’, ‘alphaLcParenBoth’, ‘romanUcParenBoth’, ‘alphaUcPe-
riod’, ‘arabicPeriod’, ‘thaiNumPeriod’, ‘hindiNumPeriod’, ‘hindiNumParenR’, ‘ea1JpnKorPlain’}
class openpyxl.drawing.text.CharacterProperties(kumimoji=None, lang=None, alt-
Lang=None, sz=None, b=None, i=None,
u=None, strike=None, kern=None,
cap=None, spc=None, normalizeH=None,
baseline=None, noProof=None,
dirty=None, err=None, smtClean=None,
smtId=None, bmk=None, ln=None,
highlight=None, latin=None, ea=None,
cs=None, sym=None, hlinkClick=None,
hlinkMouseOver=None, rtl=None,
extLst=None, noFill=None, solid-
Fill=None, gradFill=None, blip-
Fill=None, pattFill=None, grpFill=None,
effectLst=None, effectDag=None, uL-
nTx=None, uLn=None, uFillTx=None,
uFill=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
altLang
Values must be of type <class ‘str’>
b
Values must be of type <class ‘bool’>
baseline
Values must be of type <class ‘int’>
blipFill
Values must be of type <class ‘openpyxl.drawing.fill.BlipFillProperties’>
bmk
Values must be of type <class ‘str’>

9.1. openpyxl package 161


openpyxl Documentation, Release 2.4.0

cap
Value must be one of {‘all’, ‘small’}
cs
Values must be of type <class ‘openpyxl.drawing.text.Font’>
dirty
Values must be of type <class ‘bool’>
ea
Values must be of type <class ‘openpyxl.drawing.text.Font’>
effectDag
Values must be of type <class ‘openpyxl.drawing.effect.EffectContainer’>
effectLst
Values must be of type <class ‘openpyxl.drawing.effect.EffectList’>
err
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
gradFill
Values must be of type <class ‘openpyxl.drawing.fill.GradientFillProperties’>
grpFill
Values must be of type <class ‘bool’>
highlight
Values must be of type <class ‘openpyxl.styles.colors.Color’>
hlinkClick
Values must be of type <class ‘openpyxl.drawing.text.Hyperlink’>
hlinkMouseOver
Values must be of type <class ‘openpyxl.drawing.text.Hyperlink’>
i
Values must be of type <class ‘bool’>
kern
Values must be of type <class ‘int’>
kumimoji
Values must be of type <class ‘bool’>
lang
Values must be of type <class ‘str’>
latin
Values must be of type <class ‘openpyxl.drawing.text.Font’>
ln
Values must be of type <class ‘openpyxl.drawing.line.LineProperties’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
noFill
Values must be of type <class ‘bool’>
noProof
Values must be of type <class ‘bool’>

162 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

normalizeH
Values must be of type <class ‘bool’>
pattFill
Values must be of type <class ‘openpyxl.drawing.fill.PatternFillProperties’>
rtl
Values must be of type <class ‘bool’>
smtClean
Values must be of type <class ‘bool’>
smtId
Values must be of type <class ‘int’>
solidFill
Values must be of type <class ‘openpyxl.drawing.colors.ColorChoice’>
spc
Values must be of type <class ‘int’>
strike
Value must be one of {‘noStrike’, ‘dblStrike’, ‘sngStrike’}
sym
Values must be of type <class ‘openpyxl.drawing.text.Font’>
sz
Values must be of type <class ‘int’>
tagname = ‘defRPr’
u
Value must be one of {‘wavy’, ‘wavyHeavy’, ‘words’, ‘wavyDbl’, ‘dotDotDashHeavy’, ‘dottedHeavy’,
‘heavy’, ‘dashLong’, ‘dashLongHeavy’, ‘dotDashHeavy’, ‘dashHeavy’, ‘dotted’, ‘dotDotDash’, ‘dash’,
‘sng’, ‘dotDash’, ‘dbl’}
uFill
Values must be of type <class ‘bool’>
uFillTx
Values must be of type <class ‘bool’>
uLn
Values must be of type <class ‘openpyxl.drawing.line.LineProperties’>
uLnTx
Values must be of type <class ‘bool’>
class openpyxl.drawing.text.EmbeddedWAVAudioFile(name=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
name
Values must be of type <class ‘openpyxl.descriptors.base.String’>
class openpyxl.drawing.text.Font(typeface=None, panose=None, pitchFamily=None,
charset=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
charset
Values must be of type <class ‘openpyxl.descriptors.base.MinMax’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’

9.1. openpyxl package 163


openpyxl Documentation, Release 2.4.0

panose
Values must be of type <class ‘openpyxl.descriptors.excel.HexBinary’>
pitchFamily
Values must be of type <class ‘openpyxl.descriptors.base.MinMax’>
tagname = ‘latin’
typeface
Values must be of type <class ‘str’>
class openpyxl.drawing.text.GeomGuide(name=None, fmla=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
fmla
Values must be of type Values must be of type <class ‘str’>
name
Values must be of type Values must be of type <class ‘str’>
class openpyxl.drawing.text.GeomGuideList(gd=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
gd
A sequence (list or tuple) that may only contain objects of the declared type
class openpyxl.drawing.text.Hyperlink(invalidUrl=None, action=None, tgtFrame=None,
tooltip=None, history=None, highlightClick=None,
endSnd=None, snd=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
action
Values must be of type <class ‘openpyxl.descriptors.base.String’>
endSnd
Values must be of type <class ‘openpyxl.descriptors.base.Bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
highlightClick
Values must be of type <class ‘openpyxl.descriptors.base.Bool’>
history
Values must be of type <class ‘openpyxl.descriptors.base.Bool’>
invalidUrl
Values must be of type <class ‘openpyxl.descriptors.base.String’>
snd
Values must be of type <class ‘openpyxl.drawing.text.EmbeddedWAVAudioFile’>
tgtFrame
Values must be of type <class ‘openpyxl.descriptors.base.String’>
tooltip
Values must be of type <class ‘openpyxl.descriptors.base.String’>
class openpyxl.drawing.text.LineBreak(rPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
rPr
Values must be of type <class ‘openpyxl.drawing.text.CharacterProperties’>

164 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.drawing.text.ListStyle(defPPr=None, lvl1pPr=None, lvl2pPr=None,


lvl3pPr=None, lvl4pPr=None, lvl5pPr=None,
lvl6pPr=None, lvl7pPr=None, lvl8pPr=None,
lvl9pPr=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
defPPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
lvl1pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
lvl2pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
lvl3pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
lvl4pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
lvl5pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
lvl6pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
lvl7pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
lvl8pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
lvl9pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
tagname = ‘lstStyle’
class openpyxl.drawing.text.Paragraph(pPr=None, endParaRPr=None, r=None, br=None,
fld=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
br
Values must be of type <class ‘openpyxl.drawing.text.LineBreak’>
endParaRPr
Values must be of type <class ‘openpyxl.drawing.text.CharacterProperties’>
fld
Values must be of type <class ‘openpyxl.drawing.text.TextField’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
r
Values must be of type <class ‘openpyxl.drawing.text.RegularTextRun’>
tagname = ‘p’

9.1. openpyxl package 165


openpyxl Documentation, Release 2.4.0

class openpyxl.drawing.text.ParagraphProperties(marL=None, marR=None, lvl=None, in-


dent=None, algn=None, defTabSz=None,
rtl=None, eaLnBrk=None,
fontAlgn=None, latinLnBrk=None,
hangingPunct=None, lnSpc=None,
spcBef=None, spcAft=None,
tabLst=None, defRPr=None,
extLst=None, buClrTx=None, bu-
Clr=None, buSzTx=None, buSzPct=None,
buSzPts=None, buFontTx=None,
buFont=None, buNone=None,
buAutoNum=None, buChar=None,
buBlip=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
algn
Value must be one of {‘dist’, ‘r’, ‘ctr’, ‘l’, ‘just’, ‘thaiDist’, ‘justLow’}
buAutoNum
Values must be of type <class ‘bool’>
buBlip
Values must be of type <class ‘openpyxl.drawing.fill.Blip’>
buChar
Values must be of type <class ‘str’>
buClr
Values must be of type <class ‘openpyxl.styles.colors.Color’>
buClrTx
Values must be of type <class ‘bool’>
buFont
Values must be of type <class ‘openpyxl.drawing.text.Font’>
buFontTx
Values must be of type <class ‘bool’>
buNone
Values must be of type <class ‘bool’>
buSzPct
Values must be of type <class ‘int’>
buSzPts
Values must be of type <class ‘int’>
buSzTx
Values must be of type <class ‘bool’>
defRPr
Values must be of type <class ‘openpyxl.drawing.text.CharacterProperties’>
defTabSz
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
eaLnBrk
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>

166 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

fontAlgn
Value must be one of {‘b’, ‘ctr’, ‘auto’, ‘base’, ‘t’}
hangingPunct
Values must be of type <class ‘bool’>
indent
Values must be of type <class ‘int’>
latinLnBrk
Values must be of type <class ‘bool’>
lnSpc
Values must be of type <class ‘openpyxl.drawing.text.Spacing’>
lvl
Values must be of type <class ‘int’>
marL
Values must be of type <class ‘int’>
marR
Values must be of type <class ‘int’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
rtl
Values must be of type <class ‘bool’>
spcAft
Values must be of type <class ‘openpyxl.drawing.text.Spacing’>
spcBef
Values must be of type <class ‘openpyxl.drawing.text.Spacing’>
tabLst
Values must be of type <class ‘openpyxl.drawing.text.TabStopList’>
tagname = ‘pPr’
class openpyxl.drawing.text.PresetTextShape(prst=None, avLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
avLst
Values must be of type <class ‘openpyxl.drawing.text.GeomGuideList’>
prst
Values must be of type <openpyxl.descriptors.base.Set object at 0x7fd32e0830f0>
class openpyxl.drawing.text.RegularTextRun(rPr=None, t=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
rPr
Values must be of type <class ‘openpyxl.drawing.text.CharacterProperties’>
t
Values must be of type <class ‘str’>
tagname = ‘r’

9.1. openpyxl package 167


openpyxl Documentation, Release 2.4.0

class openpyxl.drawing.text.RichTextProperties(rot=None, spcFirstLastPara=None, ver-


tOverflow=None, horzOverflow=None,
vert=None, wrap=None, lIns=None,
tIns=None, rIns=None, bIns=None, num-
Col=None, spcCol=None, rtlCol=None,
fromWordArt=None, anchor=None, an-
chorCtr=None, forceAA=None, up-
right=None, compatLnSpc=None,
prstTxWarp=None, scene3d=None,
extLst=None, noAutofit=None, normAut-
ofit=None, spAutoFit=None, flatTx=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
anchor
Value must be one of {‘b’, ‘ctr’, ‘just’, ‘dist’, ‘t’}
anchorCtr
Values must be of type <class ‘bool’>
bIns
Values must be of type <class ‘int’>
compatLnSpc
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
flatTx
Values must be of type <class ‘int’>
forceAA
Values must be of type <class ‘bool’>
fromWordArt
Values must be of type <class ‘bool’>
horzOverflow
Value must be one of {‘clip’, ‘overflow’}
lIns
Values must be of type <class ‘int’>
namespace = ‘http://schemas.openxmlformats.org/drawingml/2006/main’
noAutofit
Values must be of type <class ‘bool’>
normAutofit
Values must be of type <class ‘bool’>
numCol
Values must be of type <class ‘int’>
prstTxWarp
Values must be of type <class ‘openpyxl.drawing.text.PresetTextShape’>
rIns
Values must be of type <class ‘int’>
rot
Values must be of type <class ‘int’>

168 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

rtlCol
Values must be of type <class ‘bool’>
scene3d
Values must be of type <class ‘openpyxl.drawing.shapes.Scene3D’>
spAutoFit
Values must be of type <class ‘bool’>
spcCol
Values must be of type <class ‘int’>
spcFirstLastPara
Values must be of type <class ‘bool’>
tIns
Values must be of type <class ‘int’>
tagname = ‘bodyPr’
upright
Values must be of type <class ‘bool’>
vert
Value must be one of {‘mongolianVert’, ‘eaVert’, ‘wordArtVertRtl’, ‘horz’, ‘vert270’, ‘vert’, ‘wor-
dArtVert’}
vertOverflow
Value must be one of {‘clip’, ‘ellipsis’, ‘overflow’}
wrap
Value must be one of {‘none’, ‘square’}
class openpyxl.drawing.text.Spacing(spcPct=None, spcPts=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
spcPct
Values must be of type <class ‘int’>
spcPts
Values must be of type <class ‘int’>
class openpyxl.drawing.text.TabStop(pos=None, algn=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
algn
Values must be of type <openpyxl.descriptors.base.Set object at 0x7fd32e076e80>
pos
Values must be of type <class ‘openpyxl.descriptors.base.Integer’>
class openpyxl.drawing.text.TabStopList(tab=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
tab
Values must be of type <class ‘openpyxl.drawing.text.TabStop’>
class openpyxl.drawing.text.TextField(id=None, type=None, rPr=None, pPr=None, t=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
id
Values must be of type <class ‘str’>

9.1. openpyxl package 169


openpyxl Documentation, Release 2.4.0

pPr
Values must be of type <class ‘openpyxl.drawing.text.ParagraphProperties’>
rPr
Values must be of type <class ‘openpyxl.drawing.text.CharacterProperties’>
t
Values must be of type <class ‘openpyxl.descriptors.base.String’>
type
Values must be of type <class ‘str’>
class openpyxl.drawing.text.TextNormalAutofit(fontScale=None, lnSpcReduction=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
fontScale
Values must be of type <class ‘int’>
lnSpcReduction
Values must be of type <class ‘int’>

openpyxl.formatting package

Submodules

openpyxl.formatting.formatting module
class openpyxl.formatting.formatting.ConditionalFormatting
Bases: object
Conditional formatting rules.
add(range_string, cfRule)
Add a rule such as ColorScaleRule, FormulaRule or CellIsRule
The priority will be added automatically.
setDxfStyles(wb)
update(cfRules)
openpyxl.formatting.formatting.unpack_rules(cfRules)

openpyxl.formatting.rule module
openpyxl.formatting.rule.CellIsRule(operator=None, formula=None, stopIfTrue=None,
font=None, border=None, fill=None)
Conditional formatting rule based on cell contents.
class openpyxl.formatting.rule.ColorScale(cfvo=None, color=None)
Bases: openpyxl.formatting.rule.RuleType
color
A sequence (list or tuple) that may only contain objects of the declared type
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)
Backwards compatibility

170 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.formatting.rule.DataBar(minLength=None, maxLength=None, show-


Value=None, cfvo=None, color=None)
Bases: openpyxl.formatting.rule.RuleType
color
Values must be of type <class ‘openpyxl.styles.colors.Color’>
maxLength
Values must be of type <class ‘int’>
minLength
Values must be of type <class ‘int’>
showValue
Values must be of type <class ‘bool’>
tagname = ‘dataBar’
openpyxl.formatting.rule.DataBarRule(start_type=None, start_value=None, end_type=None,
end_value=None, color=None, showValue=None, min-
Length=None, maxLength=None)
class openpyxl.formatting.rule.FormatObject(type, val=None, gte=None, extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
gte
Values must be of type <class ‘bool’>
tagname = ‘cfvo’
type
Value must be one of {‘percentile’, ‘min’, ‘percent’, ‘num’, ‘max’, ‘formula’}
val
Values must be of type <class ‘float’>
openpyxl.formatting.rule.FormulaRule(formula=None, stopIfTrue=None, font=None, bor-
der=None, fill=None)
Conditional formatting with custom differential style
class openpyxl.formatting.rule.IconSet(iconSet=None, showValue=None, percent=None, re-
verse=None, cfvo=None)
Bases: openpyxl.formatting.rule.RuleType
iconSet
Value must be one of {‘3TrafficLights1’, ‘5Quarters’, ‘4RedToBlack’, ‘3Symbols2’, ‘4Arrows’, ‘3Sym-
bols’, ‘3TrafficLights2’, ‘4Rating’, ‘5Rating’, ‘3Arrows’, ‘5Arrows’, ‘3ArrowsGray’, ‘3Flags’, ‘4Traffi-
cLights’, ‘5ArrowsGray’, ‘4ArrowsGray’, ‘3Signs’}
percent
Values must be of type <class ‘bool’>
reverse
Values must be of type <class ‘bool’>
showValue
Values must be of type <class ‘bool’>
tagname = ‘iconSet’

9.1. openpyxl package 171


openpyxl Documentation, Release 2.4.0

openpyxl.formatting.rule.IconSetRule(icon_style=None, type=None, values=None, show-


Value=None, percent=None, reverse=None)
Convenience function for creating icon set rules
class openpyxl.formatting.rule.Rule(type, dxfId=None, priority=0, stopIfTrue=None, aboveAver-
age=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)
Bases: openpyxl.descriptors.serialisable.Serialisable
aboveAverage
Values must be of type <class ‘bool’>
bottom
Values must be of type <class ‘bool’>
colorScale
Values must be of type <class ‘openpyxl.formatting.rule.ColorScale’>
dataBar
Values must be of type <class ‘openpyxl.formatting.rule.DataBar’>
dxf
Values must be of type <class ‘openpyxl.styles.differential.DifferentialStyle’>
dxfId
Values must be of type <class ‘int’>
equalAverage
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
formula
A sequence (list or tuple) that may only contain objects of the declared type
iconSet
Values must be of type <class ‘openpyxl.formatting.rule.IconSet’>
operator
Value must be one of {‘notEqual’, ‘notContains’, ‘between’, ‘beginsWith’, ‘endsWith’, ‘greaterThan’,
‘lessThanOrEqual’, ‘notBetween’, ‘containsText’, ‘greaterThanOrEqual’, ‘lessThan’, ‘equal’}
percent
Values must be of type <class ‘bool’>
priority
Values must be of type <class ‘int’>
rank
Values must be of type <class ‘int’>
stdDev
Values must be of type <class ‘int’>
stopIfTrue
Values must be of type <class ‘bool’>
tagname = ‘cfRule’
text
Values must be of type <class ‘str’>

172 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

timePeriod
Value must be one of {‘yesterday’, ‘last7Days’, ‘tomorrow’, ‘nextMonth’, ‘lastWeek’, ‘nextWeek’, ‘last-
Month’, ‘thisMonth’, ‘thisWeek’, ‘today’}
type
Value must be one of {‘aboveAverage’, ‘dataBar’, ‘top10’, ‘cellIs’, ‘expression’, ‘notContainsBlanks’,
‘colorScale’, ‘uniqueValues’, ‘beginsWith’, ‘endsWith’, ‘iconSet’, ‘containsErrors’, ‘notContainsErrors’,
‘containsBlanks’, ‘containsText’, ‘timePeriod’, ‘duplicateValues’, ‘notContainsText’}
class openpyxl.formatting.rule.RuleType
Bases: openpyxl.descriptors.serialisable.Serialisable
cfvo
A sequence (list or tuple) that may only contain objects of the declared type
class openpyxl.formatting.rule.ValueDescriptor(*args, **kw)
Bases: openpyxl.descriptors.base.Float
Expected type depends upon type attribue of parent :-(

openpyxl.packaging package

Stuff related to Office OpenXML packaging: relationships, archive, content types.

Submodules

openpyxl.packaging.manifest module
class openpyxl.packaging.manifest.FileExtension(Extension, ContentType)
Bases: openpyxl.descriptors.serialisable.Serialisable
ContentType
Values must be of type <class ‘str’>
Extension
Values must be of type <class ‘str’>
tagname = ‘Default’
class openpyxl.packaging.manifest.Manifest(Default=(), Override=())
Bases: openpyxl.descriptors.serialisable.Serialisable
Default
A sequence (list or tuple) that may only contain objects of the declared type
Override
A sequence (list or tuple) that may only contain objects of the declared type
extensions
filenames
tagname = ‘Types’
to_tree()
Custom serialisation method to allow setting a default namespace
class openpyxl.packaging.manifest.Override(PartName, ContentType)
Bases: openpyxl.descriptors.serialisable.Serialisable
ContentType
Values must be of type <class ‘str’>

9.1. openpyxl package 173


openpyxl Documentation, Release 2.4.0

PartName
Values must be of type <class ‘str’>
tagname = ‘Override’
openpyxl.packaging.manifest.write_content_types(workbook, as_template=False,
exts=None)

openpyxl.packaging.relationship module
class openpyxl.packaging.relationship.Relationship(type=None, target=None, target-
Mode=None, id=None, Id=None,
Type=None, Target=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
Represents many kinds of relationships.
Id
Values must be of type <class ‘str’>
Target
Values must be of type <class ‘str’>
TargetMode
Values must be of type <class ‘str’>
Type
Values must be of type <class ‘str’>
tagname = ‘Relationship’
class openpyxl.packaging.relationship.RelationshipList(Relationship=())
Bases: openpyxl.descriptors.serialisable.Serialisable
Relationship
A sequence (list or tuple) that may only contain objects of the declared type
append(value)
tagname = ‘Relationships’
to_tree()
openpyxl.packaging.relationship.get_dependents(archive, filename)
Normalise dependency file paths to absolute ones
Relative paths are relative to parent object

openpyxl.reader package

Submodules

openpyxl.reader.excel module
openpyxl.reader.excel.load_workbook(filename, read_only=False, keep_vba=False,
data_only=False, guess_types=False)
Open the given filename and return the workbook
Parameters
• filename (string or a file-like object open in binary mode c.f., zipfile.ZipFile) –
the path to open or a file-like object
• read_only (bool) – optimised for reading, content cannot be edited

174 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

• keep_vba (bool) – preseve vba content (this does NOT mean you can use it)
• guess_types (bool) – guess cell content type and do not read it from the file
• data_only (bool) – controls whether cells with formulae have either the formula (default)
or the value stored the last time Excel read the sheet
Return type openpyxl.workbook.Workbook

Note: When using lazy load, all worksheets will be openpyxl.worksheet.iter_worksheet.IterableWorksheet


and the returned workbook will be read-only.

openpyxl.reader.excel.repair_central_directory(zipFile, is_file_instance)
trims trailing data from the central directory code taken from http://stackoverflow.com/a/7457686/570216, cour-
tesy of Uri Cohen

openpyxl.reader.strings module
openpyxl.reader.strings.read_string_table(xml_source)
Read in all shared strings in the table

openpyxl.reader.style module

openpyxl.reader.workbook module
openpyxl.reader.workbook.read_content_types(archive)
Read content types.
openpyxl.reader.workbook.read_rels(archive)
Read relationships for a workbook
openpyxl.reader.workbook.read_sheets(archive)
Read worksheet titles and ids for a workbook

openpyxl.reader.worksheet module
class openpyxl.reader.worksheet.WorkSheetParser(wb, title, xml_source, shared_strings)
Bases: object
CELL_TAG = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}c’
FORMULA_TAG = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}f’
INLINE_STRING = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}is’
MERGE_TAG = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}mergeCell’
VALUE_TAG = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}v’
parse()
parse_auto_filter(element)
parse_cell(element)
parse_column_dimensions(col)
parse_data_validation(element)
parse_extensions(element)
parse_header_footer(element)
parse_legacy_drawing(element)

9.1. openpyxl package 175


openpyxl Documentation, Release 2.4.0

parse_margins(element)
parse_merge(element)
parse_page_setup(element)
parse_print_options(element)
parse_properties(element)
parse_row_dimensions(row)
parse_sheet_protection(element)
parse_sheet_views(element)
parse_sort(element)
parser_conditional_formatting(element)

openpyxl.styles package

class openpyxl.styles.Style(font=Font(color=Color(indexed=Values must be of type <class ‘int’>,


auto=Values must be of type <class ‘bool’>, theme=Values must be of
type <class ‘int’>)), fill=, border=, alignment=, number_format=None,
protection=)
Bases: openpyxl.styles.hashable.HashableObject
Style object containing all formatting details.
alignment
Values must be of type <class ‘openpyxl.styles.alignment.Alignment’>
border
Values must be of type <class ‘openpyxl.styles.borders.Border’>
copy()
fill
Values must be of type <class ‘openpyxl.styles.fills.Fill’>
font
Values must be of type <class ‘openpyxl.styles.fonts.Font’>
number_format
Values must be of type <class ‘str’>
protection
Values must be of type <class ‘openpyxl.styles.protection.Protection’>

Submodules

openpyxl.styles.alignment module
class openpyxl.styles.alignment.Alignment(horizontal=None, vertical=None, textRotation=0,
wrapText=None, shrinkToFit=None, indent=0,
relativeIndent=0, justifyLastLine=None, readin-
gOrder=0, text_rotation=None, wrap_text=None,
shrink_to_fit=None, mergeCell=None)
Bases: openpyxl.styles.hashable.HashableObject
Alignment options for use in styles.

176 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

horizontal
Value must be one of {‘center’, ‘general’, ‘right’, ‘centerContinuous’, ‘left’, ‘fill’, ‘justify’, ‘distributed’}
indent
Values must be of type <class ‘float’>
justifyLastLine
Values must be of type <class ‘bool’>
readingOrder
Values must be of type <class ‘float’>
relativeIndent
Values must be of type <class ‘float’>
shrinkToFit
Values must be of type <class ‘bool’>
tagname = ‘alignment’
textRotation
Value must be one of {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180}
vertical
Value must be one of {‘justify’, ‘center’, ‘top’, ‘bottom’, ‘distributed’}
wrapText
Values must be of type <class ‘bool’>

openpyxl.styles.borders module
class openpyxl.styles.borders.Border(left=, right=, top=, bottom=, diagonal=, diago-
nal_direction=None, vertical=None, horizontal=None,
diagonalUp=False, diagonalDown=False, outline=True,
start=None, end=None)
Bases: openpyxl.styles.hashable.HashableObject
Border positioning for use in styles.
bottom
Values must be of type <class ‘openpyxl.styles.borders.Side’>
diagonal
Values must be of type <class ‘openpyxl.styles.borders.Side’>
diagonalDown
Values must be of type <class ‘bool’>
diagonalUp
Values must be of type <class ‘bool’>
end
Values must be of type <class ‘openpyxl.styles.borders.Side’>
horizontal
Values must be of type <class ‘openpyxl.styles.borders.Side’>

9.1. openpyxl package 177


openpyxl Documentation, Release 2.4.0

left
Values must be of type <class ‘openpyxl.styles.borders.Side’>
outline
Values must be of type <class ‘bool’>
right
Values must be of type <class ‘openpyxl.styles.borders.Side’>
start
Values must be of type <class ‘openpyxl.styles.borders.Side’>
tagname = ‘border’
top
Values must be of type <class ‘openpyxl.styles.borders.Side’>
vertical
Values must be of type <class ‘openpyxl.styles.borders.Side’>
class openpyxl.styles.borders.Side(style=None, color=None, border_style=None)
Bases: openpyxl.styles.hashable.HashableObject
Border options for use in styles. Caution: if you do not specify a border_style, other attributes will have no
effect !
color
Values must be of type <class ‘openpyxl.styles.colors.Color’>
style
Value must be one of {‘dashed’, ‘thick’, ‘mediumDashed’, ‘thin’, ‘slantDashDot’, ‘mediumDashDotDot’,
‘dashDotDot’, ‘dashDot’, ‘medium’, ‘mediumDashDot’, ‘dotted’, ‘double’, ‘hair’}

openpyxl.styles.colors module
class openpyxl.styles.colors.Color(rgb=‘00000000’, indexed=None, auto=None, theme=None,
tint=0.0, index=None, type=’rgb’)
Bases: openpyxl.styles.hashable.HashableObject
Named colors for use in styles.
auto
Values must be of type <class ‘bool’>
index
indexed
Values must be of type <class ‘int’>
rgb
Values must be of type <class ‘str’>
tagname = ‘color’
theme
Values must be of type <class ‘int’>
tint
Values must be of type <class ‘float’>
type
Values must be of type <class ‘str’>
value

178 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.styles.colors.ColorDescriptor(*args, **kw)


Bases: openpyxl.descriptors.base.Typed
expected_type
alias of Color
class openpyxl.styles.colors.ColorList(indexedColors=None, mruColors=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
index
indexedColors
Values must be of type <class ‘openpyxl.styles.colors.IndexedColorList’>
mruColors
Values must be of type <class ‘openpyxl.styles.colors.MRUColorList’>
class openpyxl.styles.colors.IndexedColorList(rgbColor=())
Bases: openpyxl.descriptors.serialisable.Serialisable
rgbColor
A sequence (list or tuple) that may only contain objects of the declared type
class openpyxl.styles.colors.MRUColorList(color=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
color
A sequence (list or tuple) that may only contain objects of the declared type
class openpyxl.styles.colors.RGB(*args, **kw)
Bases: openpyxl.descriptors.base.Typed
Descriptor for aRGB values If not supplied alpha is 00
expected_type
alias of str
class openpyxl.styles.colors.RgbColor(rgb=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
rgb

openpyxl.styles.differential module
class openpyxl.styles.differential.DifferentialStyle(font=None, numFmt=None,
fill=None, alignment=None,
border=None, protection=None,
extLst=None)
Bases: openpyxl.styles.hashable.HashableObject
alignment
Values must be of type <class ‘openpyxl.styles.alignment.Alignment’>
border
Values must be of type <class ‘openpyxl.styles.borders.Border’>
fill
Values must be of type <class ‘openpyxl.styles.fills.Fill’>
font
Values must be of type <class ‘openpyxl.styles.fonts.Font’>
numFmt
Values must be of type <class ‘openpyxl.styles.numbers.NumberFormat’>

9.1. openpyxl package 179


openpyxl Documentation, Release 2.4.0

protection
Values must be of type <class ‘openpyxl.styles.protection.Protection’>
tagname = ‘dxf’

openpyxl.styles.fills module
class openpyxl.styles.fills.Fill
Bases: openpyxl.styles.hashable.HashableObject
Base class
classmethod from_tree(el)
tagname = ‘fill’
class openpyxl.styles.fills.GradientFill(type=’linear’, degree=0, left=0, right=0, top=0, bot-
tom=0, stop=(), fill_type=None)
Bases: openpyxl.styles.fills.Fill
bottom
Values must be of type <class ‘float’>
degree
Values must be of type <class ‘float’>
left
Values must be of type <class ‘float’>
right
Values must be of type <class ‘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)
top
Values must be of type <class ‘float’>
type
Value must be one of {‘path’, ‘linear’}
class openpyxl.styles.fills.PatternFill(patternType=None, fgColor=Color(indexed=Values
must be of type <class ‘int’>, auto=Values must be
of type <class ‘bool’>, theme=Values must be of
type <class ‘int’>), bgColor=Color(indexed=Values
must be of type <class ‘int’>, auto=Values must be
of type <class ‘bool’>, theme=Values must be of type
<class ‘int’>), fill_type=None, start_color=None,
end_color=None)
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’>
fgColor
Values must be of type <class ‘openpyxl.styles.colors.Color’>

180 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

patternType
Value must be one of {‘lightHorizontal’, ‘solid’, ‘darkTrellis’, ‘lightGray’, ‘darkGrid’, ‘gray125’,
‘lightUp’, ‘darkGray’, ‘darkVertical’, ‘lightVertical’, ‘gray0625’, ‘lightGrid’, ‘lightDown’, ‘lightTrellis’,
‘darkHorizontal’, ‘darkUp’, ‘mediumGray’, ‘darkDown’}
tagname = ‘patternFill’
to_tree(tagname=None, idx=None)

openpyxl.styles.fonts module
class openpyxl.styles.fonts.Font(name=’Calibri’, sz=11, b=False, i=False, charset=None,
u=None, strike=False, color=‘00000000’, scheme=None,
family=2, size=None, bold=None, italic=None,
strikethrough=None, underline=None, vertAlign=None, out-
line=False, shadow=False, condense=False, extend=False)
Bases: openpyxl.styles.hashable.HashableObject
Font options used in styles.
UNDERLINE_DOUBLE = ‘double’
UNDERLINE_DOUBLE_ACCOUNTING = ‘doubleAccounting’
UNDERLINE_SINGLE = ‘single’
UNDERLINE_SINGLE_ACCOUNTING = ‘singleAccounting’
b
Values must be of type <class ‘bool’>
charset
Values must be of type <class ‘int’>
color
Values must be of type <class ‘openpyxl.styles.colors.Color’>
condense
Values must be of type <class ‘bool’>
extend
Values must be of type <class ‘bool’>
family
Values must be of type <class ‘float’>
i
Values must be of type <class ‘bool’>
name
Values must be of type <class ‘str’>
outline
Values must be of type <class ‘bool’>
scheme
Value must be one of {‘minor’, ‘major’}
shadow
Values must be of type <class ‘bool’>
strike
Values must be of type <class ‘bool’>

9.1. openpyxl package 181


openpyxl Documentation, Release 2.4.0

sz
Values must be of type <class ‘float’>
tagname = ‘font’
u
Value must be one of {‘single’, ‘doubleAccounting’, ‘double’, ‘singleAccounting’}
vertAlign
Value must be one of {‘superscript’, ‘subscript’, ‘baseline’}

openpyxl.styles.hashable module
class openpyxl.styles.hashable.HashableObject
Bases: openpyxl.descriptors.serialisable.Serialisable
Define how to hash property classes.
copy(**kwargs)
key
Use a tuple of fields as the basis for a key

openpyxl.styles.named_styles module
class openpyxl.styles.named_styles.NamedCellStyle(name=None, xfId=None, buil-
tinId=None, iLevel=None, hid-
den=None, customBuiltin=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
Pointer-based representation of named styles in XML xfId refers to the corresponding CellStyleXf
builtinId
Values must be of type <class ‘int’>
customBuiltin
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
hidden
Values must be of type <class ‘bool’>
iLevel
Values must be of type <class ‘int’>
name
Values must be of type <class ‘str’>
tagname = ‘cellStyle’
xfId
Values must be of type <class ‘int’>
class openpyxl.styles.named_styles.NamedCellStyleList(count=None, cellStyle=())
Bases: openpyxl.descriptors.serialisable.Serialisable
cellStyle
A sequence (list or tuple) that may only contain objects of the declared type
count

182 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

names
Convert to NamedStyle objects and remove duplicates
tagname = ‘cellStyles’
class openpyxl.styles.named_styles.NamedStyle(name=’Normal’,
font=Font(color=Color(indexed=Values
must be of type <class ‘int’>, auto=Values
must be of type <class ‘bool’>, theme=Values
must be of type <class ‘int’>)), fill=, bor-
der=, alignment=, number_format=None,
protection=, builtinId=0, hidden=False)
Bases: openpyxl.styles.hashable.HashableObject
Named and editable styles
alignment
Values must be of type <class ‘openpyxl.styles.alignment.Alignment’>
border
Values must be of type <class ‘openpyxl.styles.borders.Border’>
builtinId
Values must be of type <class ‘int’>
fill
Values must be of type <class ‘openpyxl.styles.fills.Fill’>
font
Values must be of type <class ‘openpyxl.styles.fonts.Font’>
hidden
Values must be of type <class ‘bool’>
number_format
Values must be of type <class ‘str’>
protection
Values must be of type <class ‘openpyxl.styles.protection.Protection’>

openpyxl.styles.numbers module
class openpyxl.styles.numbers.NumberFormat(numFmtId=None, formatCode=None)
Bases: openpyxl.styles.hashable.HashableObject
formatCode
Values must be of type <class ‘str’>
numFmtId
Values must be of type <class ‘int’>
class openpyxl.styles.numbers.NumberFormatDescriptor(*args, **kw)
Bases: openpyxl.descriptors.base.String
class openpyxl.styles.numbers.NumberFormatList(count=None, numFmt=())
Bases: openpyxl.descriptors.serialisable.Serialisable
count
numFmt
A sequence (list or tuple) that may only contain objects of the declared type
openpyxl.styles.numbers.builtin_format_code(index)
Return one of the standard format codes by index.

9.1. openpyxl package 183


openpyxl Documentation, Release 2.4.0

openpyxl.styles.numbers.builtin_format_id(fmt)
Return the id of a standard style.
openpyxl.styles.numbers.is_builtin(fmt)
openpyxl.styles.numbers.is_date_format(fmt)

openpyxl.styles.protection module
class openpyxl.styles.protection.Protection(locked=True, hidden=False)
Bases: openpyxl.styles.hashable.HashableObject
Protection options for use in styles.
hidden
Values must be of type <class ‘bool’>
locked
Values must be of type <class ‘bool’>
tagname = ‘protection’

openpyxl.styles.proxy module
class openpyxl.styles.proxy.StyleProxy(target)
Bases: object
Proxy formatting objects so that they cannot be altered
copy(**kw)
Return a copy of the proxied object. Keyword args will be passed through

openpyxl.styles.styleable module
class openpyxl.styles.styleable.NumberFormatDescriptor
Bases: object
collection = ‘_number_formats’
key = ‘numFmtId’
class openpyxl.styles.styleable.StyleDescriptor(collection, key)
Bases: object
class openpyxl.styles.styleable.StyleableObject(sheet, style_array=None)
Bases: object
Base class for styleble objects implementing proxy and lookup functions
has_style
parent
pivotButton
quotePrefix
style
style_id

184 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.utils package

openpyxl.utils.absolute_coordinate(coord_string)
Convert a coordinate to an absolute coordinate string (B12 -> $B$12)
openpyxl.utils.cols_from_range(range_string)
Get individual addresses for every cell in a range. Yields one row at a time.
openpyxl.utils.column_index_from_string(str_col)
Convert a column name into a numerical index (‘A’ -> 1)
openpyxl.utils.coordinate_from_string(coord_string)
Convert a coordinate string like ‘B12’ to a tuple (‘B’, 12)
openpyxl.utils.coordinate_to_tuple(coordinate)
Convert an Excel style coordinate to (row, colum) tuple
openpyxl.utils.get_column_interval(start, end)
openpyxl.utils.get_column_letter(idx)
Convert a column index into a column letter (3 -> ‘C’)
openpyxl.utils.quote_sheetname(sheetname)
openpyxl.utils.range_boundaries(range_string)
Convert a range string into a tuple of boundaries: (min_col, min_row, max_col, max_row) Cell coordinates will
be converted into a range with the cell at both end
openpyxl.utils.range_to_tuple(range_string)
Convert a worksheet range to the sheetname and maximum and minimum coordinate indices
openpyxl.utils.rows_from_range(range_string)
Get individual addresses for every cell in a range. Yields one row at a time.

Submodules

openpyxl.utils.bound_dictionary module
class openpyxl.utils.bound_dictionary.BoundDictionary(reference=None, *args, **kw)
Bases: collections.defaultdict
A default dictionary where elements are tightly coupled.
The factory method is responsible for binding the parent object to the child.
If a reference attribute is assigned then child objects will have the key assigned to this.
Otherwise it’s just a defaultdict.

openpyxl.utils.datetime module
class openpyxl.utils.datetime.GMT
Bases: datetime.tzinfo
dst(dt)
tzname(dt)
utcoffset(dt)
openpyxl.utils.datetime.W3CDTF_to_datetime(formatted_string)
Convert from a timestamp string to a datetime object.

9.1. openpyxl package 185


openpyxl Documentation, Release 2.4.0

openpyxl.utils.datetime.datetime_to_W3CDTF(dt)
Convert from a datetime to a timestamp string.
openpyxl.utils.datetime.days_to_time(value)
openpyxl.utils.datetime.from_excel(value, offset=2415018.5)
openpyxl.utils.datetime.time_to_days(value)
Convert a time value to fractions of day
openpyxl.utils.datetime.timedelta_to_days(value)
Convert a timedelta value to fractions of a day
openpyxl.utils.datetime.to_excel(dt, offset=2415018.5)

openpyxl.utils.exceptions module
exception openpyxl.utils.exceptions.CellCoordinatesException
Bases: Exception
Error for converting between numeric and A1-style cell references.
exception openpyxl.utils.exceptions.IllegalCharacterError
Bases: Exception
The data submitted which cannot be used directly in Excel files. It must be removed or escaped.
exception openpyxl.utils.exceptions.InsufficientCoordinatesException
Bases: Exception
Error for partially specified cell coordinates.
exception openpyxl.utils.exceptions.InvalidFileException
Bases: Exception
Error for trying to open a non-ooxml file.
exception openpyxl.utils.exceptions.NamedRangeException
Bases: Exception
Error for badly formatted named ranges.
exception openpyxl.utils.exceptions.ReadOnlyWorkbookException
Bases: Exception
Error for trying to modify a read-only workbook
exception openpyxl.utils.exceptions.SheetTitleException
Bases: Exception
Error for bad sheet names.
exception openpyxl.utils.exceptions.WorkbookAlreadySaved
Bases: Exception
Error when attempting to perform operations on a dump workbook while it has already been dumped once

openpyxl.utils.indexed_list module
class openpyxl.utils.indexed_list.IndexedList(iterable=None)
Bases: list
List with optimised access by value Based on Alex Martelli’s recipe
http://code.activestate.com/recipes/52303-the-auxiliary-dictionary-idiom-for-sequences-with-/
add(value)

186 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

append(value)
index(value)

openpyxl.utils.units module
openpyxl.utils.units.DEFAULT_HEADER = 0.3
From the ECMA Spec (4th Edition part 1) Page setup: “Left Page Margin in inches” p. 1647
Docs from http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-
office-open-xml/
See also http://msdn.microsoft.com/en-us/library/dd560821(v=office.12).aspx
dxa: The main unit in OOXML is a twentieth of a point. Also called twips. pt: point. In Excel there are 72
points to an inch hp: half-points are used to specify font sizes. A font-size of 12pt equals 24 half points pct:
Half-points are used to specify font sizes. A font-size of 12pt equals 24 half points
EMU: English Metric Unit, EMUs are used for coordinates in vector-based drawings and embedded pictures.
One inch equates to 914400 EMUs and a centimeter is 360000. For bitmaps the default resolution is 96 dpi
(known as PixelsPerInch in Excel). Spec p. 1122
For radial geometry Excel uses integert units of 1/60000th of a degree.
openpyxl.utils.units.EMU_to_cm(value)
openpyxl.utils.units.EMU_to_inch(value)
openpyxl.utils.units.EMU_to_pixels(value)
openpyxl.utils.units.angle_to_degrees(value)
openpyxl.utils.units.cm_to_EMU(value)
1 cm = 360000 EMUs
openpyxl.utils.units.cm_to_dxa(value)
openpyxl.utils.units.degrees_to_angle(value)
1 degree = 60000 angles
openpyxl.utils.units.dxa_to_cm(value)
openpyxl.utils.units.dxa_to_inch(value)
openpyxl.utils.units.inch_to_EMU(value)
1 inch = 914400 EMUs
openpyxl.utils.units.inch_to_dxa(value)
1 inch = 72 * 20 dxa
openpyxl.utils.units.pixels_to_EMU(value)
1 pixel = 9525 EMUs
openpyxl.utils.units.pixels_to_points(value, dpi=96)
96 dpi, 72i
openpyxl.utils.units.points_to_pixels(value, dpi=96)
openpyxl.utils.units.short_color(color)
format a color to its short size

9.1. openpyxl package 187


openpyxl Documentation, Release 2.4.0

openpyxl.workbook package

Subpackages

openpyxl.workbook.names package

Submodules

openpyxl.workbook.names.external module
class openpyxl.workbook.names.external.ExternalBook(Id, Target, TargetMode=None,
Type=None)
Bases: openpyxl.descriptors.Strict
Map the relationship of one workbook to another
Id
Values must be of type <class ‘str’>
Target
Values must be of type <class ‘str’>
TargetMode = ‘External’
Type = ‘http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath’
class openpyxl.workbook.names.external.ExternalRange(name, refersTo=None,
sheetId=None)
Bases: openpyxl.descriptors.Strict
Map external named ranges NB. the specification for these is different to named ranges within a workbook See
18.14.5
name
Values must be of type <class ‘str’>
refersTo
Values must be of type <class ‘str’>
sheetId
Values must be of type <class ‘str’>
openpyxl.workbook.names.external.detect_external_links(rels, archive)
openpyxl.workbook.names.external.parse_books(xml)
openpyxl.workbook.names.external.parse_ranges(xml)
openpyxl.workbook.names.external.write_external_book_rel(book)
Serialise link to external file
openpyxl.workbook.names.external.write_external_link(links)
Serialise links to ranges in a single external worbook

openpyxl.workbook.names.named_range module
class openpyxl.workbook.names.named_range.NamedRange(name, destinations, scope=None)
Bases: openpyxl.workbook.names.named_range.NamedValue
A named group of cells
Scope is a worksheet object or None for workbook scope names (the default)
destinations

188 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

name
repr_format = ‘<%s “%s”>’
scope
str_format = ‘%s!%s’
value
openpyxl.workbook.names.named_range.NamedRangeContainingValue
alias of NamedValue
class openpyxl.workbook.names.named_range.NamedValue(name, value)
Bases: object
A named value
localSheetId
name
scope
value
openpyxl.workbook.names.named_range.external_range(range_string)
openpyxl.workbook.names.named_range.read_named_ranges(xml_source, workbook)
Read named ranges, excluding poorly defined ranges.
openpyxl.workbook.names.named_range.refers_to_range(range_string)
openpyxl.workbook.names.named_range.split_named_range(range_string)
Separate a named range into its component parts

Submodules

openpyxl.workbook.child module
openpyxl.workbook.child.avoid_duplicate_name(names, value)
Naive check to see whether name already exists. If name does exist suggest a name using an incrementer

openpyxl.workbook.properties module
class openpyxl.workbook.properties.CalcProperties(calcId=122211, calcMode=’auto’,
fullCalcOnLoad=True, refMode=’A1’,
iterate=False, iterateCount=None, it-
erateDelta=None, fullPrecision=None,
calcCompleted=True, calcOn-
Save=True, concurrentCalc=True,
concurrentManualCount=None, force-
FullCalc=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
calcCompleted
Values must be of type <class ‘bool’>
calcId
Values must be of type <class ‘int’>
calcMode
Value must be one of {‘auto’, ‘autoNoTable’, ‘manual’}

9.1. openpyxl package 189


openpyxl Documentation, Release 2.4.0

calcOnSave
Values must be of type <class ‘bool’>
concurrentCalc
Values must be of type <class ‘bool’>
concurrentManualCount
Values must be of type <class ‘int’>
forceFullCalc
Values must be of type <class ‘bool’>
fullCalcOnLoad
Values must be of type <class ‘bool’>
fullPrecision
Values must be of type <class ‘bool’>
iterate
Values must be of type <class ‘bool’>
iterateCount
Values must be of type <class ‘int’>
iterateDelta
Values must be of type <class ‘float’>
refMode
Value must be one of {‘A1’, ‘R1C1’}
tagname = ‘calcPr’
class openpyxl.workbook.properties.FileVersion(appName=None, lastEdited=None, low-
estEdited=None, rupBuild=None, code-
Name=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
appName
Values must be of type <class ‘str’>
codeName
lastEdited
Values must be of type <class ‘str’>
lowestEdited
Values must be of type <class ‘str’>
rupBuild
Values must be of type <class ‘str’>
tagname = ‘fileVersion’

190 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.workbook.properties.WorkbookProperties(date1904=None, dateCom-


patibility=None, showOb-
jects=None, showBorderUn-
selectedTables=None, filter-
Privacy=None, promptedSolu-
tions=None, showInkAnnota-
tion=None, backupFile=None,
saveExternalLinkValues=None,
updateLinks=’userSet’, co-
deName=None, hidePivot-
FieldList=None, showPiv-
otChartFilter=None, al-
lowRefreshQuery=None,
publishItems=None, check-
Compatibility=None, au-
toCompressPictures=None,
refreshAllConnections=None,
defaultThemeVersion=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
allowRefreshQuery
Values must be of type <class ‘bool’>
autoCompressPictures
Values must be of type <class ‘bool’>
backupFile
Values must be of type <class ‘bool’>
checkCompatibility
Values must be of type <class ‘bool’>
codeName
Values must be of type <class ‘str’>
date1904
Values must be of type <class ‘bool’>
dateCompatibility
Values must be of type <class ‘bool’>
defaultThemeVersion
Values must be of type <class ‘int’>
filterPrivacy
Values must be of type <class ‘bool’>
hidePivotFieldList
Values must be of type <class ‘bool’>
promptedSolutions
Values must be of type <class ‘bool’>
publishItems
Values must be of type <class ‘bool’>
refreshAllConnections
Values must be of type <class ‘bool’>
saveExternalLinkValues
Values must be of type <class ‘bool’>

9.1. openpyxl package 191


openpyxl Documentation, Release 2.4.0

showBorderUnselectedTables
Values must be of type <class ‘bool’>
showInkAnnotation
Values must be of type <class ‘bool’>
showObjects
Value must be one of {‘all’, ‘placeholders’}
showPivotChartFilter
Values must be of type <class ‘bool’>
tagname = ‘workbookPr’
updateLinks
Value must be one of {‘userSet’, ‘never’, ‘always’}

openpyxl.workbook.workbook module
class openpyxl.workbook.workbook.Workbook(write_only=False)
Bases: object
Workbook is the container for all other parts of the document.
active
Get the currently active sheet
add_named_range(named_range)
Add an existing named_range to the list of named_ranges.
chartsheets
create_chartsheet(title=None, index=None)
create_named_range(name, worksheet, range, scope=None)
Create a new named_range on a worksheet
create_sheet(title=None, index=None)
Create a worksheet (at an optional index).
Parameters
• title – optional title of the sheet
• index (int) – optional position at which the sheet will be inserted
data_only
get_active_sheet()
Returns the current active sheet.
get_index(worksheet)
Return the index of the worksheet.
get_named_range(name)
Return the range specified by name.
get_named_ranges()
Return all named ranges
get_sheet_by_name(name)
Returns a worksheet by its name.
Parameters name (string) – the name of the worksheet to look for
get_sheet_names()

192 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

read_only
remove_named_range(named_range)
Remove a named_range from this workbook.
remove_sheet(worksheet)
Remove a worksheet from this workbook.
save(filename)
Save the current workbook under the given filename. Use this function instead of using an ExcelWriter.

Warning: When creating your workbook using write_only set to True, you will only be
able to call this function once. Subsequents attempts to modify or save the file will raise an
openpyxl.shared.exc.WorkbookAlreadySaved exception.

sheetnames
Returns the list of the names of worksheets in the workbook.
Names are returned in the worksheets order.
Return type list of strings
worksheets
write_only

openpyxl.worksheet package

openpyxl.worksheet.isgenerator(obj)

Submodules

openpyxl.worksheet.datavalidation module
class openpyxl.worksheet.datavalidation.DataValidation(type=None, formula1=None,
formula2=None, al-
low_blank=False, showEr-
rorMessage=True, showIn-
putMessage=True, show-
DropDown=None, allow-
Blank=None, sqref=None,
promptTitle=None, er-
rorStyle=None, error=None,
prompt=None, errorTi-
tle=None, imeMode=None,
operator=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
add(cell)
Adds a openpyxl.cell to this validator
allowBlank
Values must be of type <class ‘bool’>
allow_blank
Values must be of type <class ‘bool’>
error
Values must be of type <class ‘str’>

9.1. openpyxl package 193


openpyxl Documentation, Release 2.4.0

errorStyle
Value must be one of {‘warning’, ‘stop’, ‘information’}
errorTitle
Values must be of type <class ‘str’>
formula1
Values must be of type <class ‘str’>
formula2
Values must be of type <class ‘str’>
imeMode
Value must be one of {‘fullKatakana’, ‘halfKatakana’, ‘noControl’, ‘hiragana’, ‘off’, ‘disabled’, ‘on’,
‘halfAlpha’, ‘fullAlpha’, ‘fullHangul’, ‘halfHangul’}
operator
Value must be one of {‘notEqual’, ‘between’, ‘greaterThan’, ‘lessThanOrEqual’, ‘notBetween’,
‘greaterThanOrEqual’, ‘lessThan’, ‘equal’}
prompt
Values must be of type <class ‘str’>
promptTitle
Values must be of type <class ‘str’>
showDropDown
Values must be of type <class ‘bool’>
showErrorMessage
Values must be of type <class ‘bool’>
showInputMessage
Values must be of type <class ‘bool’>
sqref
tagname = ‘dataValidation’
type
Value must be one of {‘decimal’, ‘list’, ‘custom’, ‘time’, ‘date’, ‘textLength’, ‘whole’}
class openpyxl.worksheet.datavalidation.DataValidationList(disablePrompts=None,
xWindow=None, yWin-
dow=None, count=None,
dataValidation=())
Bases: openpyxl.descriptors.serialisable.Serialisable
append(dv)
count
dataValidation
A sequence (list or tuple) that may only contain objects of the declared type
disablePrompts
Values must be of type <class ‘bool’>
tagname = ‘dataValidations’
xWindow
Values must be of type <class ‘int’>
yWindow
Values must be of type <class ‘int’>

194 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.worksheet.datavalidation.collapse_cell_addresses(cells, input_ranges=())
Collapse a collection of cell co-ordinates down into an optimal range or collection of ranges.
E.g. Cells A1, A2, A3, B1, B2 and B3 should have the data-validation object applied, attempt to collapse down
to a single range, A1:B3.
Currently only collapsing contiguous vertical ranges (i.e. above example results in A1:A3 B1:B3). More work
to come.
openpyxl.worksheet.datavalidation.expand_cell_ranges(range_string)
Expand cell ranges to a sequence of addresses. Reverse of collapse_cell_addresses Eg. converts “A1:A2 B1:B2”
to (A1, A2, B1, B2)

openpyxl.worksheet.dimensions module
class openpyxl.worksheet.dimensions.ColumnDimension(worksheet, index=’A’, width=None,
bestFit=False, hidden=False, out-
lineLevel=0, outline_level=None,
collapsed=False, style=None,
min=None, max=None, cus-
tomWidth=False, visible=None,
auto_size=None)
Bases: openpyxl.worksheet.dimensions.Dimension
Information about the display properties of a column.
bestFit
Values must be of type <class ‘bool’>
collapsed
Values must be of type <class ‘bool’>
customWidth
Always true if there is a width for the column
index
Values must be of type <class ‘str’>
max
Values must be of type <class ‘int’>
min
Values must be of type <class ‘int’>
width
Values must be of type <class ‘float’>
class openpyxl.worksheet.dimensions.Dimension(index, hidden, outlineLevel, collapsed, work-
sheet, visible=True, style=None)
Bases: openpyxl.descriptors.Strict, openpyxl.styles.styleable.StyleableObject
Information about the display properties of a row or column.
collapsed
Values must be of type <class ‘bool’>
hidden
Values must be of type <class ‘bool’>
index
Values must be of type <class ‘int’>
outlineLevel
Values must be of type <class ‘int’>

9.1. openpyxl package 195


openpyxl Documentation, Release 2.4.0

visible
class openpyxl.worksheet.dimensions.DimensionHolder(worksheet, reference=’index’, de-
fault_factory=None)
Bases: openpyxl.utils.bound_dictionary.BoundDictionary
Allow columns to be grouped
group(start, end=None, outline_level=1, hidden=False)
allow grouping a range of consecutive columns together
Parameters
• start – first column to be grouped (mandatory)
• end – last column to be grouped (optional, default to start)
• outline_level – outline level
• hidden – should the group be hidden on workbook open or not
class openpyxl.worksheet.dimensions.RowDimension(worksheet, index=0, ht=None, cus-
tomHeight=None, s=None, custom-
Format=None, hidden=False, out-
lineLevel=0, outline_level=None,
collapsed=False, visible=None,
height=None, r=None, spans=None,
thickBot=None, thickTop=None, **kw)
Bases: openpyxl.worksheet.dimensions.Dimension
Information about the display properties of a row.
customFormat
Always true if there is a style for the row
customHeight
Always true if there is a height for the row
ht
Values must be of type <class ‘float’>
thickBot
Values must be of type <class ‘bool’>
thickTop
Values must be of type <class ‘bool’>

openpyxl.worksheet.drawing module
class openpyxl.worksheet.drawing.Drawing(id=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
id
Values must be of type <class ‘str’>
tagname = ‘drawing’

openpyxl.worksheet.filters module
class openpyxl.worksheet.filters.AutoFilter(ref=None, filterColumn=(), sortState=None,
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable

196 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

add_filter_column(col_id, vals, blank=False)


Add row filter for specified column.
Parameters
• col_id (int) – Zero-origin column id. 0 means first column.
• vals (str[]) – Value list to show.
• blank (bool) – Show rows that have blank cell if True (default=‘‘False‘‘)
add_sort_condition(ref, descending=False)
Add sort condition for cpecified range of cells.
Parameters
• ref (string) – range of the cells (e.g. ‘A2:A150’)
• descending (bool) – Descending sort order (default=‘‘False‘‘)
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
filterColumn
A sequence (list or tuple) that may only contain objects of the declared type
ref
Values must be of type <class ‘str’>
sortState
Values must be of type <class ‘openpyxl.worksheet.filters.SortState’>
tagname = ‘autoFilter’
class openpyxl.worksheet.filters.CellRange(*args, **kw)
Bases: openpyxl.descriptors.base.Convertible, openpyxl.descriptors.base.MatchPattern

allow_none = True
expected_type
alias of str
pattern = ‘\n[$]?(?P<min_col>[A-Z]+)\n[$]?(?P<min_row>\\d+)\n(:[$]?(?P<max_col>[A-Z]+)\n[$]?(?P<max_row>\\d+)
class openpyxl.worksheet.filters.ColorFilter(dxfId=None, cellColor=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
cellColor
Values must be of type <class ‘bool’>
dxfId
Values must be of type <class ‘int’>
class openpyxl.worksheet.filters.CustomFilter(operator=None, val=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
operator
Value must be one of {‘notEqual’, ‘greaterThan’, ‘lessThanOrEqual’, ‘greaterThanOrEqual’, ‘lessThan’,
‘equal’}
val
Values must be of type <class ‘str’>
class openpyxl.worksheet.filters.CustomFilters(_and=None, customFilter=None)
Bases: openpyxl.descriptors.serialisable.Serialisable

9.1. openpyxl package 197


openpyxl Documentation, Release 2.4.0

customFilter
Values must be of type <class ‘openpyxl.worksheet.filters.CustomFilter’>
class openpyxl.worksheet.filters.DateGroupItem(year=None, month=None, day=None,
hour=None, minute=None, second=None,
dateTimeGrouping=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
dateTimeGrouping
Value must be one of {‘second’, ‘hour’, ‘year’, ‘minute’, ‘month’, ‘day’}
day
Values must be of type <class ‘int’>
hour
Values must be of type <class ‘int’>
minute
Values must be of type <class ‘int’>
month
Values must be of type <class ‘int’>
second
Values must be of type <class ‘int’>
year
Values must be of type <class ‘int’>
class openpyxl.worksheet.filters.DynamicFilter(type=None, val=None, valIso=None, max-
Val=None, maxValIso=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
maxVal
Values must be of type <class ‘float’>
maxValIso
Values must be of type <class ‘datetime.datetime’>
type
Value must be one of {‘M10’, ‘yesterday’, ‘tomorrow’, ‘nextMonth’, ‘null’, ‘M12’, ‘nextWeek’, ‘nex-
tYear’, ‘today’, ‘lastYear’, ‘lastWeek’, ‘M3’, ‘M11’, ‘lastQuarter’, ‘lastMonth’, ‘Q4’, ‘thisYear’, ‘Q2’,
‘M6’, ‘M2’, ‘belowAverage’, ‘M4’, ‘Q3’, ‘yearToDate’, ‘M5’, ‘M9’, ‘thisQuarter’, ‘M1’, ‘M8’, ‘aboveAv-
erage’, ‘Q1’, ‘M7’, ‘thisMonth’, ‘thisWeek’, ‘nextQuarter’}
val
Values must be of type <class ‘float’>
valIso
Values must be of type <class ‘datetime.datetime’>
class openpyxl.worksheet.filters.FilterColumn(colId=None, hiddenButton=None, show-
Button=None, filters=None, top10=None,
customFilters=None, dynamicFilter=None,
colorFilter=None, iconFilter=None,
extLst=None, blank=None, vals=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
colId
Values must be of type <class ‘int’>
colorFilter
Values must be of type <class ‘openpyxl.worksheet.filters.ColorFilter’>

198 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

customFilters
Values must be of type <class ‘openpyxl.worksheet.filters.CustomFilters’>
dynamicFilter
Values must be of type <class ‘openpyxl.worksheet.filters.DynamicFilter’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
filters
Values must be of type <class ‘openpyxl.worksheet.filters.Filters’>
hiddenButton
Values must be of type <class ‘bool’>
iconFilter
Values must be of type <class ‘openpyxl.worksheet.filters.IconFilter’>
showButton
Values must be of type <class ‘bool’>
tagname = ‘filterColumn’
top10
Values must be of type <class ‘openpyxl.worksheet.filters.Top10’>
class openpyxl.worksheet.filters.Filters(blank=None, calendarType=None, filter=(), date-
GroupItem=())
Bases: openpyxl.descriptors.serialisable.Serialisable
blank
Values must be of type <class ‘bool’>
calendarType
Value must be one of {‘gregorianMeFrench’, ‘japan’, ‘gregorianArabic’, ‘gregorianXlitEnglish’, ‘taiwan’,
‘gregorianUs’, ‘gregorian’, ‘korea’, ‘saka’, ‘gregorianXlitFrench’, ‘hijri’, ‘thai’, ‘hebrew’}
dateGroupItem
A sequence (list or tuple) that may only contain objects of the declared type
filter
A sequence of primitive types that are stored as a single attribute. “val” is the default attribute
class openpyxl.worksheet.filters.IconFilter(iconSet=None, iconId=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
iconId
Values must be of type <class ‘int’>
iconSet
Value must be one of {‘3TrafficLights1’, ‘5Quarters’, ‘4RedToBlack’, ‘3Symbols2’, ‘4Arrows’, ‘3Sym-
bols’, ‘3TrafficLights2’, ‘4Rating’, ‘5Rating’, ‘3Arrows’, ‘5Arrows’, ‘3ArrowsGray’, ‘3Flags’, ‘4Traffi-
cLights’, ‘5ArrowsGray’, ‘4ArrowsGray’, ‘3Signs’}
class openpyxl.worksheet.filters.SortCondition(ref=None, descending=None,
sortBy=None, customList=None, dx-
fId=None, iconSet=None, iconId=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
customList
Values must be of type <class ‘str’>
descending
Values must be of type <class ‘bool’>

9.1. openpyxl package 199


openpyxl Documentation, Release 2.4.0

dxfId
Values must be of type <class ‘int’>
iconId
Values must be of type <class ‘int’>
iconSet
Value must be one of {‘3TrafficLights1’, ‘5Quarters’, ‘4RedToBlack’, ‘3Symbols2’, ‘4Arrows’, ‘3Sym-
bols’, ‘3TrafficLights2’, ‘4Rating’, ‘5Rating’, ‘3Arrows’, ‘5Arrows’, ‘3ArrowsGray’, ‘3Flags’, ‘4Traffi-
cLights’, ‘5ArrowsGray’, ‘4ArrowsGray’, ‘3Signs’}
ref
Values must be of type <class ‘str’>
sortBy
Value must be one of {‘value’, ‘icon’, ‘cellColor’, ‘fontColor’}
tagname = ‘sortCondition’
class openpyxl.worksheet.filters.SortState(columnSort=None, caseSensitive=None, sort-
Method=None, ref=None, sortCondition=(),
extLst=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
caseSensitive
Values must be of type <class ‘bool’>
columnSort
Values must be of type <class ‘bool’>
extLst
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
ref
Values must be of type <class ‘str’>
sortCondition
A sequence (list or tuple) that may only contain objects of the declared type
sortMethod
Value must be one of {‘stroke’, ‘pinYin’}
tagname = ‘sortState’
class openpyxl.worksheet.filters.Top10(top=None, percent=None, val=None, filterVal=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
filterVal
Values must be of type <class ‘float’>
percent
Values must be of type <class ‘bool’>
top
Values must be of type <class ‘bool’>
val
Values must be of type <class ‘float’>

openpyxl.worksheet.header_footer module
class openpyxl.worksheet.header_footer.HeaderFooter
Bases: object

200 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

Information about the header/footer for this sheet.


center_footer
center_header
getFooter()
getHeader()
hasFooter()
hasHeader()
left_footer
left_header
right_footer
right_header
setFooter(item)
setHeader(item)
class openpyxl.worksheet.header_footer.HeaderFooterItem(type)
Bases: object
Individual left/center/right header/footer items
Header & Footer ampersand codes:
•&A Inserts the worksheet name
•&B Toggles bold
•&D or &[Date] Inserts the current date
•&E Toggles double-underline
•&F or &[File] Inserts the workbook name
•&I Toggles italic
•&N or &[Pages] Inserts the total page count
•&S Toggles strikethrough
•&T Inserts the current time
•&[Tab] Inserts the worksheet name
•&U Toggles underline
•&X Toggles superscript
•&Y Toggles subscript
•&P or &[Page] Inserts the current page number
•&P+n Inserts the page number incremented by n
•&P-n Inserts the page number decremented by n
•&[Path] Inserts the workbook path
•&& Escapes the ampersand character
•&”fontname” Selects the named font
•&nn Selects the specified 2-digit font point size

9.1. openpyxl package 201


openpyxl Documentation, Release 2.4.0

CENTER = ‘C’
LEFT = ‘L’
REPLACE_LIST = ((‘\n’, ‘_x000D_’), (‘&[Page]’, ‘&P’), (‘&[Pages]’, ‘&N’), (‘&[Date]’, ‘&D’), (‘&[Time]’, ‘&T’), (‘&[Pa
RIGHT = ‘R’
font_color
font_name
font_size
get()
has()
set(text)
Convert a compound string into attributes # incomplete because formatting commands can be nested
text
type

openpyxl.worksheet.hyperlink module
class openpyxl.worksheet.hyperlink.Hyperlink(ref=None, location=None, tooltip=None, dis-
play=None, id=None, target=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
display
Values must be of type <class ‘str’>
id
Values must be of type <class ‘str’>
location
Values must be of type <class ‘str’>
ref
Values must be of type <class ‘str’>
tagname = ‘hyperlink’
target
Values must be of type <class ‘str’>
tooltip
Values must be of type <class ‘str’>

openpyxl.worksheet.page module
class openpyxl.worksheet.page.PageMargins(left=0.75, right=0.75, top=1, bottom=1,
header=0.5, footer=0.5)
Bases: openpyxl.descriptors.serialisable.Serialisable
Information about page margins for view/print layouts. Standard values (in inches) left, right = 0.75 top, bottom
= 1 header, footer = 0.5
bottom
Values must be of type <class ‘float’>
footer
Values must be of type <class ‘float’>

202 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

header
Values must be of type <class ‘float’>
left
Values must be of type <class ‘float’>
right
Values must be of type <class ‘float’>
tagname = ‘pageMargins’
top
Values must be of type <class ‘float’>
class openpyxl.worksheet.page.PrintOptions(horizontalCentered=None, verticalCen-
tered=None, headings=None, gridLines=None,
gridLinesSet=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
Worksheet print options
gridLines
Values must be of type <class ‘bool’>
gridLinesSet
Values must be of type <class ‘bool’>
headings
Values must be of type <class ‘bool’>
horizontalCentered
Values must be of type <class ‘bool’>
tag = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}printOptions’
tagname = ‘printOptions’
verticalCentered
Values must be of type <class ‘bool’>
class openpyxl.worksheet.page.PrintPageSetup(worksheet=None, orientation=None, paper-
Size=None, scale=None, fitToHeight=None,
fitToWidth=None, firstPageNumber=None,
useFirstPageNumber=None, paper-
Height=None, paperWidth=None, pa-
geOrder=None, usePrinterDefaults=None,
blackAndWhite=None, draft=None, cell-
Comments=None, errors=None, hor-
izontalDpi=None, verticalDpi=None,
copies=None, id=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
Worksheet print page setup
autoPageBreaks
blackAndWhite
Values must be of type <class ‘bool’>
cellComments
Value must be one of {‘asDisplayed’, ‘atEnd’}
copies
Values must be of type <class ‘int’>

9.1. openpyxl package 203


openpyxl Documentation, Release 2.4.0

draft
Values must be of type <class ‘bool’>
errors
Value must be one of {‘displayed’, ‘blank’, ‘dash’, ‘NA’}
firstPageNumber
Values must be of type <class ‘int’>
fitToHeight
Values must be of type <class ‘int’>
fitToPage
fitToWidth
Values must be of type <class ‘int’>
classmethod from_tree(node)
horizontalCentered()
horizontalDpi
Values must be of type <class ‘int’>
id
Values must be of type <class ‘str’>
options()
orientation
Value must be one of {‘default’, ‘portrait’, ‘landscape’}
pageOrder
Value must be one of {‘downThenOver’, ‘overThenDown’}
paperHeight
paperSize
Values must be of type <class ‘int’>
paperWidth
scale
Values must be of type <class ‘int’>
setup()
sheet_properties
Proxy property
tagname = ‘pageSetup’
to_tree()
useFirstPageNumber
Values must be of type <class ‘bool’>
usePrinterDefaults
Values must be of type <class ‘bool’>
verticalCentered()
verticalDpi
Values must be of type <class ‘int’>

204 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.worksheet.pagebreak module
class openpyxl.worksheet.pagebreak.Break(id=0, min=0, max=16383, man=True, pt=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
id
Values must be of type <class ‘int’>
man
Values must be of type <class ‘bool’>
max
Values must be of type <class ‘int’>
min
Values must be of type <class ‘int’>
pt
Values must be of type <class ‘bool’>
tagname = ‘brk’
class openpyxl.worksheet.pagebreak.PageBreak(count=None, manualBreakCount=None,
brk=[])
Bases: openpyxl.descriptors.serialisable.Serialisable
append(brk=None)
Add a page break
brk
A sequence (list or tuple) that may only contain objects of the declared type
count
manualBreakCount
tagname = ‘rowBreaks’

openpyxl.worksheet.properties module
class openpyxl.worksheet.properties.Outline(applyStyles=None, summaryBelow=None, sum-
maryRight=None, showOutlineSymbols=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
applyStyles
Values must be of type <class ‘bool’>
showOutlineSymbols
Values must be of type <class ‘bool’>
summaryBelow
Values must be of type <class ‘bool’>
summaryRight
Values must be of type <class ‘bool’>
tag = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}outlinePr’
tagname = ‘outlinePr’
class openpyxl.worksheet.properties.PageSetupProperties(autoPageBreaks=None,
fitToPage=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
autoPageBreaks
Values must be of type <class ‘bool’>

9.1. openpyxl package 205


openpyxl Documentation, Release 2.4.0

fitToPage
Values must be of type <class ‘bool’>
tag = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}pageSetUpPr’
tagname = ‘pageSetUpPr’
class openpyxl.worksheet.properties.WorksheetProperties(codeName=None, enable-
FormatConditionsCalcula-
tion=None, filterMode=None,
published=None, syncHori-
zontal=None, syncRef=None,
syncVertical=None, tran-
sitionEvaluation=None,
transitionEntry=None,
tabColor=None, out-
linePr=None, pageSe-
tUpPr=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
codeName
Values must be of type <class ‘str’>
enableFormatConditionsCalculation
Values must be of type <class ‘bool’>
filterMode
Values must be of type <class ‘bool’>
outlinePr
Values must be of type <class ‘openpyxl.worksheet.properties.Outline’>
pageSetUpPr
Values must be of type <class ‘openpyxl.worksheet.properties.PageSetupProperties’>
published
Values must be of type <class ‘bool’>
syncHorizontal
Values must be of type <class ‘bool’>
syncRef
Values must be of type <class ‘str’>
syncVertical
Values must be of type <class ‘bool’>
tabColor
Values must be of type <class ‘openpyxl.styles.colors.Color’>
tag = ‘{http://schemas.openxmlformats.org/spreadsheetml/2006/main}sheetPr’
tagname = ‘sheetPr’
transitionEntry
Elements
transitionEvaluation
Values must be of type <class ‘bool’>

openpyxl.worksheet.protection module

206 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

class openpyxl.worksheet.protection.SheetProtection(sheet=False, objects=False,


scenarios=False, format-
Cells=True, formatRows=True,
formatColumns=True, in-
sertColumns=True, in-
sertRows=True, insertHyper-
links=True, deleteColumns=True,
deleteRows=True, selectLocked-
Cells=False, selectUnlocked-
Cells=False, sort=True, autoFil-
ter=True, pivotTables=True, pass-
word=None, algorithmName=None,
saltValue=None, spinCount=None,
hashValue=None)
Bases: openpyxl.descriptors.serialisable.Serialisable,
openpyxl.worksheet.protection._Protected
Information about protection of various aspects of a sheet. True values mean that protection for the object or
action is active This is the default when protection is active, ie. users cannot do something
algorithmName
Values must be of type <class ‘str’>
autoFilter
Values must be of type <class ‘bool’>
deleteColumns
Values must be of type <class ‘bool’>
deleteRows
Values must be of type <class ‘bool’>
disable()
enable()
formatCells
Values must be of type <class ‘bool’>
formatColumns
Values must be of type <class ‘bool’>
formatRows
Values must be of type <class ‘bool’>
hashValue
Values must be of type <class ‘str’>
insertColumns
Values must be of type <class ‘bool’>
insertHyperlinks
Values must be of type <class ‘bool’>
insertRows
Values must be of type <class ‘bool’>
objects
Values must be of type <class ‘bool’>
pivotTables
Values must be of type <class ‘bool’>

9.1. openpyxl package 207


openpyxl Documentation, Release 2.4.0

saltValue
Values must be of type <class ‘str’>
scenarios
Values must be of type <class ‘bool’>
selectLockedCells
Values must be of type <class ‘bool’>
selectUnlockedCells
Values must be of type <class ‘bool’>
set_password(value=’‘, already_hashed=False)
sheet
Values must be of type <class ‘bool’>
sort
Values must be of type <class ‘bool’>
spinCount
Values must be of type <class ‘int’>
tagname = ‘sheetProtection’
openpyxl.worksheet.protection.hash_password(plaintext_password=’‘)
Create a password hash from a given string for protecting a worksheet only. This will not work for encrypting a
workbook.
This method is based on the algorithm provided by Daniel Rentz of OpenOffice and the
PEAR package Spreadsheet_Excel_Writer by Xavier Noguer <[email protected]>. See also
http://blogs.msdn.com/b/ericwhite/archive/2008/02/23/the-legacy-hashing-algorithm-in-open-xml.aspx

openpyxl.worksheet.read_only module
class openpyxl.worksheet.read_only.ReadOnlyWorksheet(parent_workbook, title, work-
sheet_path, xml_source,
shared_strings)
Bases: openpyxl.worksheet.worksheet.Worksheet
calculate_dimension(force=False)
columns
get_squared_range(min_col, min_row, max_col, max_row)
The source worksheet file may have columns or rows missing. Missing cells will be created.
max_column
max_row
min_column
min_row
rows
xml_source
Parse xml source on demand, default to Excel archive
openpyxl.worksheet.read_only.read_dimension(source)

208 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.worksheet.related module
class openpyxl.worksheet.related.Related(id=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
id
Values must be of type <class ‘str’>
to_tree(tagname)

openpyxl.worksheet.views module
class openpyxl.worksheet.views.Pane(xSplit=None, ySplit=None, topLeftCell=None, ac-
tivePane=’topLeft’, state=’split’)
Bases: openpyxl.descriptors.serialisable.Serialisable
activePane
Value must be one of {‘topLeft’, ‘bottomRight’, ‘bottomLeft’, ‘topRight’}
state
Value must be one of {‘frozenSplit’, ‘frozen’, ‘split’}
topLeftCell
Values must be of type <class ‘str’>
xSplit
Values must be of type <class ‘float’>
ySplit
Values must be of type <class ‘float’>
class openpyxl.worksheet.views.Selection(pane=None, activeCell=’A1’, activeCellId=None,
sqref=’A1’)
Bases: openpyxl.descriptors.serialisable.Serialisable
activeCell
Values must be of type <class ‘str’>
activeCellId
Values must be of type <class ‘int’>
pane
Value must be one of {‘topLeft’, ‘bottomRight’, ‘bottomLeft’, ‘topRight’}
sqref
Values must be of type <class ‘str’>
class openpyxl.worksheet.views.SheetView(windowProtection=None, showFormulas=None,
showGridLines=True, showRowColHeaders=None,
showZeros=None, rightToLeft=None, tabSe-
lected=None, showRuler=None, showOutli-
neSymbols=None, defaultGridColor=None,
showWhiteSpace=None, view=None, topLeft-
Cell=None, colorId=None, zoomScale=None,
zoomScaleNormal=None, zoomScaleSheetLay-
outView=None, zoomScalePageLayoutView=None,
workbookViewId=0, selection=None, pane=None)
Bases: openpyxl.descriptors.serialisable.Serialisable
Information about the visible portions of this sheet.
colorId
Values must be of type <class ‘int’>

9.1. openpyxl package 209


openpyxl Documentation, Release 2.4.0

defaultGridColor
Values must be of type <class ‘bool’>
pane
Values must be of type <class ‘openpyxl.worksheet.views.Pane’>
rightToLeft
Values must be of type <class ‘bool’>
selection
A sequence (list or tuple) that may only contain objects of the declared type
showFormulas
Values must be of type <class ‘bool’>
showGridLines
Values must be of type <class ‘bool’>
showOutlineSymbols
Values must be of type <class ‘bool’>
showRowColHeaders
Values must be of type <class ‘bool’>
showRuler
Values must be of type <class ‘bool’>
showWhiteSpace
Values must be of type <class ‘bool’>
showZeros
Values must be of type <class ‘bool’>
tabSelected
Values must be of type <class ‘bool’>
tagname = ‘sheetView’
topLeftCell
Values must be of type <class ‘str’>
view
Value must be one of {‘normal’, ‘pageBreakPreview’, ‘pageLayout’}
windowProtection
Values must be of type <class ‘bool’>
workbookViewId
Values must be of type <class ‘int’>
zoomScale
Values must be of type <class ‘int’>
zoomScaleNormal
Values must be of type <class ‘int’>
zoomScalePageLayoutView
Values must be of type <class ‘int’>
zoomScaleSheetLayoutView
Values must be of type <class ‘int’>

210 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.worksheet.worksheet module
class openpyxl.worksheet.worksheet.Worksheet(parent, title=None)
Bases: openpyxl.workbook.child._WorkbookChild
Represents a worksheet.
Do not create worksheets yourself, use openpyxl.workbook.Workbook.create_sheet() instead
BREAK_COLUMN = 2
BREAK_NONE = 0
BREAK_ROW = 1
ORIENTATION_LANDSCAPE = ‘landscape’
ORIENTATION_PORTRAIT = ‘portrait’
PAPERSIZE_A3 = ‘8’
PAPERSIZE_A4 = ‘9’
PAPERSIZE_A4_SMALL = ‘10’
PAPERSIZE_A5 = ‘11’
PAPERSIZE_EXECUTIVE = ‘7’
PAPERSIZE_LEDGER = ‘4’
PAPERSIZE_LEGAL = ‘5’
PAPERSIZE_LETTER = ‘1’
PAPERSIZE_LETTER_SMALL = ‘2’
PAPERSIZE_STATEMENT = ‘6’
PAPERSIZE_TABLOID = ‘3’
SHEETSTATE_HIDDEN = ‘hidden’
SHEETSTATE_VERYHIDDEN = ‘veryHidden’
SHEETSTATE_VISIBLE = ‘visible’
active_cell
add_chart(chart, anchor=None)
Add a chart to the sheet Optionally provide a cell for the top-left anchor
add_data_validation(data_validation)
Add a data-validation object to the sheet. The data-validation object defines the type of data-validation to
be applied and the cell or range of cells it should apply to.
add_image(img, anchor=None)
Add an image to the sheet. Optionally provide a cell for the top-left anchor
add_print_title(n, rows_or_cols=’rows’)
Print Titles are rows or columns that are repeated on each printed sheet. This adds n rows or columns at
the top or left of the sheet
append(iterable)
Appends a group of values at the bottom of the current sheet.
•If it’s a list: all values are added in order, starting from the first column
•If it’s a dict: values are assigned to the columns indicated by the keys (numbers or letters)

9.1. openpyxl package 211


openpyxl Documentation, Release 2.4.0

Parameters iterable (list/tuple/range/generator or dict) – list, range or generator, or dict


containing values to append

Usage:
•append([’This is A1’, ‘This is B1’, ‘This is C1’])
•or append({‘A’ : ‘This is A1’, ‘C’ : ‘This is C1’})
•or append({1 : ‘This is A1’, 3 : ‘This is C1’})

Raise TypeError when iterable is neither a list/tuple nor a dict

calculate_dimension()
Return the minimum bounding range for all cells containing data.
cell(coordinate=None, row=None, column=None, value=None)
Returns a cell object based on the given coordinates.
Usage: cell(coodinate=’A15’) or cell(row=15, column=1)
If coordinates are not given, then row and column must be given.
Cells are kept in a dictionary which is empty at the worksheet creation. Calling cell creates the cell in
memory when they are first accessed, to reduce memory usage.
Parameters
• coordinate (string) – coordinates of the cell (e.g. ‘B12’)
• row (int) – row index of the cell (e.g. 4)
• column (int) – column index of the cell (e.g. 3)
Raise InsufficientCoordinatesException when coordinate or (row and column) are not given
Return type :class:openpyxl.cell.Cell
columns
Iterate over all columns in the worksheet
dimensions
freeze_panes
get_cell_collection()
Return an unordered list of the cells in this worksheet.
get_named_range(range_string)
Returns a 2D array of cells, with optional row and column offsets.
Parameters range_string (string) – named range name
Return type tuples of tuples of openpyxl.cell.Cell
get_squared_range(min_col, min_row, max_col, max_row)
Returns a 2D array of cells
Parameters
• min_col (int) – smallest column index (1-based index)
• min_row (int) – smallest row index (1-based index)
• max_col (int) – largest column index (1-based index)
• max_row (int) – smallest row index (1-based index)

212 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

Return type generator


iter_rows(range_string=None, row_offset=0, column_offset=0)
Returns a squared range based on the range_string parameter, using generators. If no range is passed, will
iterate over all cells in the worksheet
Parameters
• range_string (string) – range of cells (e.g. ‘A1:C4’)
• row_offset – additional rows (e.g. 4)
• column_offset – additonal columns (e.g. 3)
Return type generator
max_column
Get the largest value for column currently stored.
Return type int
max_row
Returns the maximum row index containing data
Return type int
merge_cells(range_string=None, start_row=None, start_column=None, end_row=None,
end_column=None)
Set merge on a cell range. Range is a cell range (e.g. A1:E1)
merged_cell_ranges
Public attribute for which cells have been merged
merged_cells
Utility for checking whether a cell has been merged or not
min_column
min_row
point_pos(left=0, top=0)
tells which cell is under the given coordinates (in pixels) counting from the top-left corner of the sheet.
Can be used to locate images and charts on the worksheet
rows
Iterate over all rows in the worksheet
selected_cell
set_printer_settings(paper_size, orientation)
Set printer settings
show_gridlines
show_summary_below
show_summary_right
unmerge_cells(range_string=None, start_row=None, start_column=None, end_row=None,
end_column=None)
Remove merge on a cell range. Range is a cell range (e.g. A1:E1)
vba_code
openpyxl.worksheet.worksheet.flatten(results)
Return cell values row-by-row
openpyxl.worksheet.worksheet.isgenerator(obj)

9.1. openpyxl package 213


openpyxl Documentation, Release 2.4.0

openpyxl.writer package

Submodules

openpyxl.writer.etree_worksheet module
openpyxl.writer.etree_worksheet.get_rows_to_write(worksheet)
Return all rows, and any cells that they contain
openpyxl.writer.etree_worksheet.write_cell(worksheet, cell, styled=None)
openpyxl.writer.etree_worksheet.write_rows(xf, worksheet)
Write worksheet data to xml.

openpyxl.writer.excel module
class openpyxl.writer.excel.ExcelWriter(workbook)
Bases: object
Write a workbook object to an Excel file.
comment_writer
alias of CommentWriter
save(filename, as_template=False)
Write data into the archive.
write_data(archive, as_template=False)
Write the various xml files into the zip archive.
openpyxl.writer.excel.save_virtual_workbook(workbook, as_template=False)
Return an in-memory workbook, suitable for a Django response.
openpyxl.writer.excel.save_workbook(workbook, filename, as_template=False)
Save the given workbook on the filesystem under the name filename.
Parameters
• workbook (openpyxl.workbook.Workbook) – the workbook to save
• filename (string) – the path to which save the workbook
Return type bool

openpyxl.writer.lxml_worksheet module
openpyxl.writer.lxml_worksheet.write_cell(xf, worksheet, cell, styled=False)
openpyxl.writer.lxml_worksheet.write_rows(xf, worksheet)
Write worksheet data to xml.

openpyxl.writer.relations module
openpyxl.writer.relations.write_rels(worksheet, comments_id=None,
vba_controls_id=None)
Write relationships for the worksheet to xml.

openpyxl.writer.strings module
openpyxl.writer.strings.write_string_table(string_table)
Write the string table xml.

openpyxl.writer.styles module

214 Chapter 9. API Documentation


openpyxl Documentation, Release 2.4.0

openpyxl.writer.theme module
openpyxl.writer.theme.write_theme()
Write the theme xml.

openpyxl.writer.workbook module
openpyxl.writer.workbook.write_properties_app(workbook)
Write the properties xml.
openpyxl.writer.workbook.write_root_rels(workbook)
Write the relationships xml.
openpyxl.writer.workbook.write_workbook(workbook)
Write the core workbook xml.
openpyxl.writer.workbook.write_workbook_rels(workbook)
Write the workbook relationships xml.

openpyxl.writer.worksheet module
openpyxl.writer.worksheet.write_cols(worksheet)
Write worksheet columns to xml.
<cols> may never be empty - spec says must contain at least one child
openpyxl.writer.worksheet.write_conditional_formatting(worksheet)
Write conditional formatting to xml.
openpyxl.writer.worksheet.write_drawing(worksheet)
Add link to drawing if required
openpyxl.writer.worksheet.write_format(worksheet)
openpyxl.writer.worksheet.write_header_footer(worksheet)
openpyxl.writer.worksheet.write_hyperlinks(worksheet)
Write worksheet hyperlinks to xml.
openpyxl.writer.worksheet.write_mergecells(worksheet)
Write merged cells to xml.
openpyxl.writer.worksheet.write_worksheet(worksheet, shared_strings)
Write a worksheet to an xml file.

openpyxl.writer.write_only module
openpyxl.writer.write_only.WriteOnlyCell(ws=None, value=None)
class openpyxl.writer.write_only.WriteOnlyWorksheet(parent_workbook, title)
Bases: openpyxl.worksheet.worksheet.Worksheet
Streaming worksheet using lxml Optimised to reduce memory by writing rows just in time Cells can be styled
and have comments Styles for rows and columns must be applied before writing cells
append(row)
Parameters row (iterable) – iterable containing values to append
cell(*args, **kw)
close()
filename
merge_cells(*args, **kw)

9.1. openpyxl package 215


openpyxl Documentation, Release 2.4.0

range(*args, **kw)
writer = None
openpyxl.writer.write_only.create_temporary_file(suffix=’‘)
openpyxl.writer.write_only.isgenerator(obj)
openpyxl.writer.write_only.removed_method(*args, **kw)
openpyxl.writer.write_only.save_dump(workbook, filename)

openpyxl.xml package

openpyxl.xml.lxml_available()
openpyxl.xml.lxml_env_set()

Submodules

openpyxl.xml.constants module

openpyxl.xml.functions module
openpyxl.xml.functions.ConditionalElement(node, tag, condition, attr=None)
Utility function for adding nodes if certain criteria are fulfilled An optional attribute can be passed in which will
always be serialised as ‘1’
openpyxl.xml.functions.iterparse(source, *args, **kw)
openpyxl.xml.functions.localname(node)
openpyxl.xml.functions.safe_iterator(node, tag=None)
Return an iterator that is compatible with Python 2.6
openpyxl.xml.functions.safe_iterparse(source, *args, **kw)

openpyxl.xml.namespace module

216 Chapter 9. API Documentation


CHAPTER 10

Indices and tables

• genindex
• modindex
• search

217
openpyxl Documentation, Release 2.4.0

218 Chapter 10. Indices and tables


CHAPTER 11

Release Notes

11.1 2.4.0 (unreleased)

11.1.1 Minor changes

• Remove deprecated methods from DataValidation


• Convert AutoFilter to Serialisable and extend support for filters
• Add support for SortState
• Removed use_iterators keyword when loading workbooks. Use read_only instead.

11.1.2 Deprecations

Cell anchor method Worksheet point_pos method Comment text attribute

11.2 2.3.2 (unreleased)

11.3 2.3.1 (2015-11-20)

11.3.1 Bug fixes

• #534 Exception when using columns property in read-only mode.


• #536 Incorrectly handle comments from Google Docs files.
• #539 Flexible value types for conditional formatting.
• #542 Missing content types for images.
• #543 Make sure images fit containers on all OSes.
• #544 Gracefully handle missing cell styles.
• #546 ExternalLink duplicated when editing a file with macros.
• #548 Exception with non-ASCII worksheet titles
• #551 Combine multiple LineCharts

219
openpyxl Documentation, Release 2.4.0

11.3.2 Minor changes

• PR 88 Fix page margins in parser.

11.4 2.3.0 (2015-10-20)

11.4.1 Major changes

• Support the creation of chartsheets

11.4.2 Bug fixes

• #532 Problems when cells have no style in read-only mode.

11.4.3 Minor changes

• PR 79 Make PlotArea editable in charts


• Use graphicalProperties as the alias for spPr

11.5 2.3.0-b2 (2015-09-04)

11.5.1 Bug fixes

• #488 Support hashValue attribute for sheetProtection


• #493 Warn that unsupported extensions will be dropped
• #494 Cells with exponentials causes a ValueError
• #497 Scatter charts are broken
• #499 Inconsistent conversion of localised datetimes
• #500 Adding images leads to unreadable files
• #509 Improve handling of sheet names
• #515 Non-ascii titles have bad repr
• #516 Ignore unassigned worksheets

11.5.2 Minor changes

• Worksheets are now iterable by row.


• Assign individual cell styles only if they are explicitly set.

220 Chapter 11. Release Notes


openpyxl Documentation, Release 2.4.0

11.6 2.3.0-b1 (2015-06-29)

11.6.1 Major changes

• Shift to using (row, column) indexing for cells. Cells will at some point lose coordinates.
• New implementation of conditional formatting. Databars now partially preserved.
• et_xmlfile is now a standalone library.
• Complete rewrite of chart package
• Include a tokenizer for fomulae to be able to adjust cell references in them. PR 63

11.6.2 Minor changes

• Read-only and write-only worksheets renamed.


• Write-only workbooks support charts and images.
• PR76 Prevent comment images from conflicting with VBA

11.6.3 Bug fixes

• #81 Support stacked bar charts


• #88 Charts break hyperlinks
• #97 Pie and combination charts
• #99 Quote worksheet names in chart references
• #150 Support additional chart options
• #172 Support surface charts
• #381 Preserve named styles
• #470 Adding more than 10 worksheets with the same name leads to duplicates sheet names and an invalid file

11.7 2.2.6 (unreleased)

11.7.1 Bug fixes

• #502 Unexpected keyword “mergeCell”


• #503 tostring missing in dump_worksheet
• #506 Non-ASCII formulae cannot be parsed
• #508 Cannot save files with coloured tabs
• Regex for ignoring named ranges is wrong (character class instead of prefix)

11.6. 2.3.0-b1 (2015-06-29) 221


openpyxl Documentation, Release 2.4.0

11.8 2.2.5 (2015-06-29)

11.8.1 Bug fixes

• #463 Unexpected keyword “mergeCell”


• #484 Unusual dimensions breaks read-only mode
• #485 Move return out of loop

11.9 2.2.4 (2015-06-17)

11.9.1 Bug fixes

• #464 Cannot use images when preserving macros


• #465 ws.cell() returns an empty cell on read-only workbooks
• #467 Cannot edit a file with ActiveX components
• #471 Sheet properties elements must be in order
• #475 Do not redefine class __slots__ in subclasses
• #477 Write-only support for SheetProtection
• #478 Write-only support for DataValidation
• Improved regex when checking for datetime formats

11.10 2.2.3 (2015-05-26)

11.10.1 Bug fixes

• #451 fitToPage setting ignored


• #458 Trailing spaces lost when saving files.
• #459 setup.py install fails with Python 3
• #462 Vestigial rId conflicts when adding charts, images or comments
• #455 Enable Zip64 extensions for all versions of Python

11.11 2.2.2 (2015-04-28)

11.11.1 Bug fixes

• #447 Uppercase datetime number formats not recognised.


• #453 Borders broken in shared_styles.

222 Chapter 11. Release Notes


openpyxl Documentation, Release 2.4.0

11.12 2.2.1 (2015-03-31)

11.12.1 Minor changes

• PR54 Improved precision on times near midnight.


• PR55 Preserve macro buttons

11.12.2 Bug fixes

• #429 Workbook fails to load because header and footers cannot be parsed.
• #433 File-like object with encoding=None
• #434 SyntaxError when writing page breaks.
• #436 Read-only mode duplicates empty rows.
• #437 Cell.offset raises an exception
• #438 Cells with pivotButton and quotePrefix styles cannot be read
• #440 Error when customised versions of builtin formats
• #442 Exception raised when a fill element contains no children
• #444 Styles cannot be copied

11.13 2.2.0 (2015-03-11)

11.13.1 Bug fixes

• #415 Improved exception when passing in invalid in memory files.

11.14 2.2.0-b1 (2015-02-18)

11.14.1 Major changes

• Cell styles deprecated, use formatting objects (fonts, fills, borders, etc.) directly instead
• Charts will no longer try and calculate axes by default
• Support for template file types - PR21
• Moved ancillary functions and classes into utils package - single place of reference
• PR 34 Fully support page setup
• Removed SAX-based XML Generator. Special thanks to Elias Rabel for implementing xmlfile for xml.etree
• Preserve sheet view definitions in existing files (frozen panes, zoom, etc.)

11.12. 2.2.1 (2015-03-31) 223


openpyxl Documentation, Release 2.4.0

11.14.2 Bug fixes

• #103 Set the zoom of a sheet


• #199 Hide gridlines
• #215 Preserve sheet view setings
• #262 Set the zoom of a sheet
• #392 Worksheet header not read
• #387 Cannot read files without styles.xml
• #410 Exception when preserving whitespace in strings
• #417 Cannot create print titles
• #420 Rename confusing constants
• #422 Preserve color index in a workbook if it differs from the standard

11.14.3 Minor changes

• Use a 2-way cache for column index lookups


• Clean up tests in cells
• PR 40 Support frozen panes and autofilter in write-only mode
• Use ws.calculate_dimension(force=True) in read-only mode for unsized worksheets

11.15 2.1.5 (2015-02-18)

11.15.1 Bug fixes

• #403 Cannot add comments in write-only mode


• #401 Creating cells in an empty row raises an exception
• #408 from_excel adjustment for Julian dates 1 < x < 60
• #409 refersTo is an optional attribute

11.15.2 Minor changes

• Allow cells to be appended to standard worksheets for code compatibility with write-only mode.

11.16 2.1.4 (2014-12-16)

11.16.1 Bug fixes

• #393 IterableWorksheet skips empty cells in rows


• #394 Date format is applied to all columns (while only first column contains dates)
• #395 temporary files not cleaned properly

224 Chapter 11. Release Notes


openpyxl Documentation, Release 2.4.0

• #396 Cannot write “=” in Excel file


• #398 Cannot write empty rows in write-only mode with LXML installed

11.16.2 Minor changes

• Add relation namespace to root element for compatibility with iWork


• Serialize comments relation in LXML-backend

11.17 2.1.3 (2014-12-09)

11.17.1 Minor changes

• PR 31 Correct tutorial
• PR 32 See #380
• PR 37 Bind worksheet to ColumnDimension objects

11.17.2 Bug fixes

• #379 ws.append() doesn’t set RowDimension Correctly


• #380 empty cells formatted as datetimes raise exceptions

11.18 2.1.2 (2014-10-23)

11.18.1 Minor changes

• PR 30 Fix regex for positive exponentials


• PR 28 Fix for #328

11.18.2 Bug fixes

• #120, #168 defined names with formulae raise exceptions, #292


• #328 ValueError when reading cells with hyperlinks
• #369 IndexError when reading definedNames
• #372 number_format not consistently applied from styles

11.19 2.1.1 (2014-10-08)

11.19.1 Minor changes

• PR 20 Support different workbook code names


• Allow auto_axis keyword for ScatterCharts

11.17. 2.1.3 (2014-12-09) 225


openpyxl Documentation, Release 2.4.0

11.19.2 Bug fixes

• #332 Fills lost in ConditionalFormatting


• #360 Support value=”none” in attributes
• #363 Support undocumented value for textRotation
• #364 Preserve integers in read-only mode
• #366 Complete read support for DataValidation
• #367 Iterate over unsized worksheets

11.20 2.1.0 (2014-09-21)

11.20.1 Major changes

• “read_only” and “write_only” new flags for workbooks


• Support for reading and writing worksheet protection
• Support for reading hidden rows
• Cells now manage their styles directly
• ColumnDimension and RowDimension object manage their styles directly
• Use xmlfile for writing worksheets if available - around 3 times faster
• Datavalidation now part of the worksheet package

11.20.2 Minor changes

• Number formats are now just strings


• Strings can be used for RGB and aRGB colours for Fonts, Fills and Borders
• Create all style tags in a single pass
• Performance improvement when appending rows
• Cleaner conversion of Python to Excel values
• PR6 reserve formatting for empty rows
• standard worksheets can append from ranges and generators

11.20.3 Bug fixes

• #153 Cannot read visibility of sheets and rows


• #181 No content type for worksheets
• 241 Cannot read sheets with inline strings
• 322 1-indexing for merged cells
• 339 Correctly handle removal of cell protection
• 341 Cells with formulae do not round-trip

226 Chapter 11. Release Notes


openpyxl Documentation, Release 2.4.0

• 347 Read DataValidations


• 353 Support Defined Named Ranges to external workbooks

11.21 2.0.5 (2014-08-08)

11.21.1 Bug fixes

• #348 incorrect casting of boolean strings


• #349 roundtripping cells with formulae

11.22 2.0.4 (2014-06-25)

11.22.1 Minor changes

• Add a sample file illustrating colours

11.22.2 Bug fixes

• #331 DARKYELLOW was incorrect


• Correctly handle extend attribute for fonts

11.23 2.0.3 (2014-05-22)

11.23.1 Minor changes

• Updated docs

11.23.2 Bug fixes

• #319 Cannot load Workbooks with vertAlign styling for fonts

11.24 2.0.2 (2014-05-13)

11.25 2.0.1 (2014-05-13) brown bag

11.26 2.0.0 (2014-05-13) brown bag

11.26.1 Major changes

• This is last release that will support Python 3.2


• Cells are referenced with 1-indexing: A1 == cell(row=1, column=1)

11.21. 2.0.5 (2014-08-08) 227


openpyxl Documentation, Release 2.4.0

• Use jdcal for more efficient and reliable conversion of datetimes


• Significant speed up when reading files
• Merged immutable styles
• Type inference is disabled by default
• RawCell renamed ReadOnlyCell
• ReadOnlyCell.internal_value and ReadOnlyCell.value now behave the same as Cell
• Provide no size information on unsized worksheets
• Lower memory footprint when reading files

11.26.2 Minor changes

• All tests converted to pytest


• Pyflakes used for static code analysis
• Sample code in the documentation is automatically run
• Support GradientFills
• BaseColWidth set

11.26.3 Pull requests

• #70 Add filterColumn, sortCondition support to AutoFilter


• #80 Reorder worksheets parts
• #82 Update API for conditional formatting
• #87 Add support for writing Protection styles, others
• #89 Better handling of content types when preserving macros

11.26.4 Bug fixes

• #46 ColumnDimension style error


• #86 reader.worksheet.fast_parse sets booleans to integers
• #98 Auto sizing column widths does not work
• #137 Workbooks with chartsheets
• #185 Invalid PageMargins
• #230 Using v in cells creates invalid files
• #243 - IndexError when loading workbook
• #263 - Forded conversion of line breaks
• #267 - Raise exceptions when passed invalid types
• #270 - Cannot open files which use non-standard sheet names or reference Ids
• #269 - Handling unsized worksheets in IterableWorksheet

228 Chapter 11. Release Notes


openpyxl Documentation, Release 2.4.0

• #270 - Handling Workbooks with non-standard references


• #275 - Handling auto filters where there are only custom filters
• #277 - Harmonise chart and cell coordinates
• #280- Explicit exception raising for invalid characters
• #286 - Optimized writer can not handle a datetime.time value
• #296 - Cell coordinates not consistent with documentation
• #300 - Missing column width causes load_workbook() exception
• #304 - Handling Workbooks with absolute paths for worksheets (from Sharepoint)

11.27 1.8.6 (2014-05-05)

11.27.1 Minor changes

Fixed typo for import Elementtree

11.27.2 Bugfixes

• #279 Incorrect path for comments files on Windows

11.28 1.8.5 (2014-03-25)

11.28.1 Minor changes

• The ‘=’ string is no longer interpreted as a formula


• When a client writes empty xml tags for cells (e.g. <c r=’A1’></c>), reader will not crash

11.29 1.8.4 (2014-02-25)

11.29.1 Bugfixes

• #260 better handling of undimensioned worksheets


• #268 non-ascii in formualae
• #282 correct implementation of register_namepsace for Python 2.6

11.30 1.8.3 (2014-02-09)

11.30.1 Major changes

Always parse using cElementTree

11.27. 1.8.6 (2014-05-05) 229


openpyxl Documentation, Release 2.4.0

11.30.2 Minor changes

Slight improvements in memory use when parsing


• #256 - error when trying to read comments with optimised reader
• #260 - unsized worksheets
• #264 - only numeric cells can be dates

11.31 1.8.2 (2014-01-17)

• #247 - iterable worksheets open too many files


• #252 - improved handling of lxml
• #253 - better handling of unique sheetnames

11.32 1.8.1 (2014-01-14)

• #246

11.33 1.8.0 (2014-01-08)

11.33.1 Compatibility

Support for Python 2.5 dropped.

11.33.2 Major changes

• Support conditional formatting


• Support lxml as backend
• Support reading and writing comments
• pytest as testrunner now required
• Improvements in charts: new types, more reliable

11.33.3 Minor changes

• load_workbook now accepts data_only to allow extracting values only from formulae. Default is false.
• Images can now be anchored to cells
• Docs updated
• Provisional benchmarking
• Added convenience methods for accessing worksheets and cells by key

230 Chapter 11. Release Notes


openpyxl Documentation, Release 2.4.0

11.34 1.7.0 (2013-10-31)

11.34.1 Major changes

Drops support for Python < 2.5 and last version to support Python 2.5

11.34.2 Compatibility

Tests run on Python 2.5, 2.6, 2.7, 3.2, 3.3

11.34.3 Merged pull requests

• 27 Include more metadata


• 41 Able to read files with chart sheets
• 45 Configurable Worksheet classes
• 3 Correct serialisation of Decimal
• 36 Preserve VBA macros when reading files
• 44 Handle empty oddheader and oddFooter tags
• 43 Fixed issue that the reader never set the active sheet
• 33 Reader set value and type explicitly and TYPE_ERROR checking
• 22 added page breaks, fixed formula serialization
• 39 Fix Python 2.6 compatibility
• 47 Improvements in styling

11.34.4 Known bugfixes

• #109
• #165
• #179
• #209
• #112
• #166
• #109
• #223
• #124
• #157

11.34. 1.7.0 (2013-10-31) 231


openpyxl Documentation, Release 2.4.0

11.34.5 Miscellaneous

Performance improvements in optimised writer


Docs updated

232 Chapter 11. Release Notes


Python Module Index

o openpyxl.chartsheet.publish, 118
openpyxl, 3 openpyxl.chartsheet.relation, 119
openpyxl.cell, 77 openpyxl.chartsheet.tests, 114
openpyxl.cell.cell, 77 openpyxl.chartsheet.tests.test_chartsheet,
openpyxl.cell.interface, 78 114
openpyxl.cell.read_only, 79 openpyxl.chartsheet.tests.test_custom,
openpyxl.cell.text, 79 114
openpyxl.chart, 81 openpyxl.chartsheet.tests.test_properties,
openpyxl.chart.area_chart, 81 114
openpyxl.chart.axis, 82 openpyxl.chartsheet.tests.test_protection,
openpyxl.chart.bar_chart, 88 115
openpyxl.chart.bubble_chart, 89 openpyxl.chartsheet.tests.test_publish,
openpyxl.chart.chartspace, 90 115
openpyxl.chart.data_source, 95 openpyxl.chartsheet.tests.test_relation,
openpyxl.chart.descriptors, 96 115
openpyxl.chart.error_bar, 97 openpyxl.chartsheet.tests.test_views,
openpyxl.chart.label, 97 115
openpyxl.chart.layout, 99 openpyxl.chartsheet.views, 120
openpyxl.chart.legend, 100 openpyxl.comments, 120
openpyxl.chart.line_chart, 100 openpyxl.comments.author, 120
openpyxl.chart.marker, 102 openpyxl.comments.comments, 121
openpyxl.chart.picture, 103 openpyxl.comments.properties, 121
openpyxl.chart.pie_chart, 103 openpyxl.comments.reader, 122
openpyxl.chart.radar_chart, 105 openpyxl.comments.writer, 123
openpyxl.chart.reference, 105 openpyxl.descriptors, 123
openpyxl.chart.scatter_chart, 106 openpyxl.descriptors.base, 123
openpyxl.chart.series, 106 openpyxl.descriptors.excel, 125
openpyxl.chart.series_factory, 109 openpyxl.descriptors.namespace, 126
openpyxl.chart.shapes, 109 openpyxl.descriptors.nested, 126
openpyxl.chart.stock_chart, 110 openpyxl.descriptors.sequence, 127
openpyxl.chart.surface_chart, 110 openpyxl.descriptors.serialisable, 127
openpyxl.chart.text, 111 openpyxl.drawing, 128
openpyxl.chart.title, 112 openpyxl.drawing.colors, 128
openpyxl.chart.trendline, 112 openpyxl.drawing.drawing, 132
openpyxl.chart.updown_bars, 113 openpyxl.drawing.effect, 132
openpyxl.chartsheet, 114 openpyxl.drawing.fill, 139
openpyxl.chartsheet.chartsheet, 116 openpyxl.drawing.graphic, 144
openpyxl.chartsheet.custom, 116 openpyxl.drawing.image, 150
openpyxl.chartsheet.properties, 117 openpyxl.drawing.line, 150
openpyxl.chartsheet.protection, 117 openpyxl.drawing.shape, 152
openpyxl.drawing.shapes, 153

233
openpyxl Documentation, Release 2.4.0

openpyxl.drawing.spreadsheet_drawing, openpyxl.worksheet.worksheet, 211


158 openpyxl.writer, 214
openpyxl.drawing.text, 161 openpyxl.writer.etree_worksheet, 214
openpyxl.formatting, 170 openpyxl.writer.excel, 214
openpyxl.formatting.formatting, 170 openpyxl.writer.lxml_worksheet, 214
openpyxl.formatting.rule, 170 openpyxl.writer.relations, 214
openpyxl.packaging, 173 openpyxl.writer.strings, 214
openpyxl.packaging.manifest, 173 openpyxl.writer.theme, 215
openpyxl.packaging.relationship, 174 openpyxl.writer.workbook, 215
openpyxl.reader, 174 openpyxl.writer.worksheet, 215
openpyxl.reader.excel, 174 openpyxl.writer.write_only, 215
openpyxl.reader.strings, 175 openpyxl.xml, 216
openpyxl.reader.workbook, 175 openpyxl.xml.constants, 216
openpyxl.reader.worksheet, 175 openpyxl.xml.functions, 216
openpyxl.styles, 176 openpyxl.xml.namespace, 216
openpyxl.styles.alignment, 176
openpyxl.styles.borders, 177
openpyxl.styles.colors, 178
openpyxl.styles.differential, 179
openpyxl.styles.fills, 180
openpyxl.styles.fonts, 181
openpyxl.styles.hashable, 182
openpyxl.styles.named_styles, 182
openpyxl.styles.numbers, 183
openpyxl.styles.protection, 184
openpyxl.styles.proxy, 184
openpyxl.styles.styleable, 184
openpyxl.utils, 185
openpyxl.utils.bound_dictionary, 185
openpyxl.utils.datetime, 185
openpyxl.utils.exceptions, 186
openpyxl.utils.indexed_list, 186
openpyxl.utils.units, 187
openpyxl.workbook, 188
openpyxl.workbook.child, 189
openpyxl.workbook.names, 188
openpyxl.workbook.names.external, 188
openpyxl.workbook.names.named_range, 188
openpyxl.workbook.properties, 189
openpyxl.workbook.workbook, 192
openpyxl.worksheet, 193
openpyxl.worksheet.datavalidation, 193
openpyxl.worksheet.dimensions, 195
openpyxl.worksheet.drawing, 196
openpyxl.worksheet.filters, 196
openpyxl.worksheet.header_footer, 200
openpyxl.worksheet.hyperlink, 202
openpyxl.worksheet.page, 202
openpyxl.worksheet.pagebreak, 205
openpyxl.worksheet.properties, 205
openpyxl.worksheet.protection, 206
openpyxl.worksheet.read_only, 208
openpyxl.worksheet.related, 209
openpyxl.worksheet.views, 209

234 Python Module Index


Index

A add_chart() (openpyxl.chartsheet.chartsheet.Chartsheet
a (openpyxl.drawing.effect.AlphaReplaceEffect at- method), 116
tribute), 133 add_chart() (openpyxl.worksheet.worksheet.Worksheet
aboveAverage (openpyxl.formatting.rule.Rule attribute), method), 211
172 add_data_validation() (open-
absolute_coordinate() (in module openpyxl.utils), 185 pyxl.worksheet.worksheet.Worksheet method),
AbsoluteAnchor (class in open- 211
pyxl.drawing.spreadsheet_drawing), 158 add_filter_column() (open-
pyxl.worksheet.filters.AutoFilter
absoluteAnchor (openpyxl.drawing.spreadsheet_drawing.SpreadsheetDrawing method),
attribute), 160 196
AbstractCell (class in openpyxl.cell.interface), 78 add_image() (openpyxl.worksheet.worksheet.Worksheet
accent1 (openpyxl.drawing.colors.ColorMapping at- method), 211
tribute), 129 add_named_range() (open-
accent2 (openpyxl.drawing.colors.ColorMapping at- pyxl.workbook.workbook.Workbook method),
tribute), 129 192
accent3 (openpyxl.drawing.colors.ColorMapping at- add_print_title() (open-
tribute), 129 pyxl.worksheet.worksheet.Worksheet method),
accent4 (openpyxl.drawing.colors.ColorMapping at- 211
tribute), 129 add_sort_condition() (open-
accent5 (openpyxl.drawing.colors.ColorMapping at- pyxl.worksheet.filters.AutoFilter method),
tribute), 129 197
accent6 (openpyxl.drawing.colors.ColorMapping at- AdjPoint2D (class in openpyxl.drawing.shapes), 153
tribute), 129 AdjustHandleList (class in openpyxl.drawing.shapes),
action (openpyxl.drawing.text.Hyperlink attribute), 164 153
active (openpyxl.workbook.workbook.Workbook at- ahLst (openpyxl.drawing.shapes.CustomGeometry2D at-
tribute), 192 tribute), 154
active_cell (openpyxl.worksheet.worksheet.Worksheet at- algn (openpyxl.drawing.effect.OuterShadowEffect
tribute), 211 attribute), 136
activeCell (openpyxl.worksheet.views.Selection at- algn (openpyxl.drawing.effect.ReflectionEffect attribute),
tribute), 209 138
activeCellId (openpyxl.worksheet.views.Selection at- algn (openpyxl.drawing.fill.TileInfoProperties attribute),
tribute), 209 143
activePane (openpyxl.worksheet.views.Pane attribute), algn (openpyxl.drawing.line.LineProperties attribute),
209 151
add() (openpyxl.formatting.formatting.ConditionalFormattingalgn (openpyxl.drawing.text.ParagraphProperties at-
method), 170 tribute), 166
add() (openpyxl.utils.indexed_list.IndexedList method), algn (openpyxl.drawing.text.TabStop attribute), 169
186 algorithmName (openpyxl.chartsheet.protection.ChartsheetProtection
add() (openpyxl.worksheet.datavalidation.DataValidation attribute), 118
method), 193 algorithmName (openpyxl.worksheet.protection.SheetProtection
attribute), 207

235
openpyxl Documentation, Release 2.4.0

Alias (class in openpyxl.descriptors.base), 123 tribute), 130


Alignment (class in openpyxl.styles.alignment), 176 alphaMod (openpyxl.drawing.fill.Blip attribute), 140
alignment (openpyxl.cell.read_only.ReadOnlyCell alphaModFix (openpyxl.drawing.fill.Blip attribute), 140
attribute), 79 AlphaModulateEffect (class in openpyxl.drawing.effect),
alignment (openpyxl.cell.text.PhoneticProperties at- 132
tribute), 80 AlphaModulateFixedEffect (class in open-
alignment (openpyxl.styles.differential.DifferentialStyle pyxl.drawing.effect), 132
attribute), 179 alphaOff (openpyxl.drawing.colors.SystemColor at-
alignment (openpyxl.styles.named_styles.NamedStyle at- tribute), 130
tribute), 183 alphaRepl (openpyxl.drawing.fill.Blip attribute), 140
alignment (openpyxl.styles.Style attribute), 176 AlphaReplaceEffect (class in openpyxl.drawing.effect),
allow_blank (openpyxl.worksheet.datavalidation.DataValidation 132
attribute), 193 altLang (openpyxl.drawing.text.CharacterProperties at-
allow_none (openpyxl.chart.descriptors.NestedGapAmount tribute), 161
attribute), 96 altText (openpyxl.comments.properties.Properties at-
allow_none (openpyxl.chart.descriptors.NestedOverlap tribute), 122
attribute), 97 amt (openpyxl.drawing.effect.AlphaModulateFixedEffect
allow_none (openpyxl.chart.descriptors.NumberFormatDescriptor attribute), 132
attribute), 97 amt (openpyxl.drawing.effect.TintEffect attribute), 139
allow_none (openpyxl.chart.title.TitleDescriptor at- anchor (openpyxl.cell.cell.Cell attribute), 77
tribute), 112 anchor (openpyxl.comments.properties.Properties at-
allow_none (openpyxl.descriptors.base.MatchPattern at- tribute), 122
tribute), 124 anchor (openpyxl.drawing.drawing.Drawing attribute),
allow_none (openpyxl.descriptors.base.Max attribute), 132
124 anchor (openpyxl.drawing.shapes.Backdrop attribute),
allow_none (openpyxl.descriptors.base.Min attribute), 153
124 anchor (openpyxl.drawing.text.RichTextProperties
allow_none (openpyxl.descriptors.base.Typed attribute), attribute), 168
125 anchor() (openpyxl.drawing.image.Image method), 150
allow_none (openpyxl.descriptors.excel.Relation at- AnchorClientData (class in open-
tribute), 125 pyxl.drawing.spreadsheet_drawing), 159
allow_none (openpyxl.drawing.colors.ColorChoiceDescriptor anchorCtr (openpyxl.drawing.text.RichTextProperties at-
attribute), 129 tribute), 168
allow_none (openpyxl.worksheet.filters.CellRange AnchorMarker (class in open-
attribute), 197 pyxl.drawing.spreadsheet_drawing), 159
allowBlank (openpyxl.worksheet.datavalidation.DataValidation
ang (openpyxl.drawing.fill.LinearShadeProperties at-
attribute), 193 tribute), 142
allowRefreshQuery (open- ang (openpyxl.drawing.shapes.ConnectionSite attribute),
pyxl.workbook.properties.WorkbookProperties 154
attribute), 191 angle_to_degrees() (in module openpyxl.utils.units), 187
alpha (openpyxl.drawing.colors.SystemColor attribute), append() (openpyxl.packaging.relationship.RelationshipList
130 method), 174
alphaBiLevel (openpyxl.drawing.fill.Blip attribute), 140 append() (openpyxl.utils.indexed_list.IndexedList
AlphaBiLevelEffect (class in openpyxl.drawing.effect), method), 187
132 append() (openpyxl.worksheet.datavalidation.DataValidationList
alphaCeiling (openpyxl.drawing.fill.Blip attribute), 140 method), 194
AlphaCeilingEffect (class in openpyxl.drawing.effect), append() (openpyxl.worksheet.pagebreak.PageBreak
132 method), 205
alphaFloor (openpyxl.drawing.fill.Blip attribute), 140 append() (openpyxl.worksheet.worksheet.Worksheet
AlphaFloorEffect (class in openpyxl.drawing.effect), 132 method), 211
alphaInv (openpyxl.drawing.fill.Blip attribute), 140 append() (openpyxl.writer.write_only.WriteOnlyWorksheet
AlphaInverseEffect (class in openpyxl.drawing.effect), method), 215
132 applyStyles (openpyxl.worksheet.properties.Outline at-
alphaMod (openpyxl.drawing.colors.SystemColor at- tribute), 205

236 Index
openpyxl Documentation, Release 2.4.0

applyToEnd (openpyxl.chart.picture.PictureOptions at- tribute), 92


tribute), 103 avLst (openpyxl.drawing.shapes.CustomGeometry2D at-
applyToFront (openpyxl.chart.picture.PictureOptions at- tribute), 154
tribute), 103 avLst (openpyxl.drawing.shapes.PresetGeometry2D at-
applyToSides (openpyxl.chart.picture.PictureOptions at- tribute), 156
tribute), 103 avLst (openpyxl.drawing.text.PresetTextShape attribute),
appName (openpyxl.workbook.properties.FileVersion at- 167
tribute), 190 avoid_duplicate_name() (in module open-
area3DChart (openpyxl.chart.chartspace.PlotArea at- pyxl.workbook.child), 189
tribute), 93 AxDataSource (class in openpyxl.chart.data_source), 95
AreaChart (class in openpyxl.chart.area_chart), 81 axId (openpyxl.chart.axis.DateAxis attribute), 82
areaChart (openpyxl.chart.chartspace.PlotArea attribute), axId (openpyxl.chart.axis.NumericAxis attribute), 84
93 axId (openpyxl.chart.axis.SeriesAxis attribute), 85
AreaChart3D (class in openpyxl.chart.area_chart), 82 axId (openpyxl.chart.axis.TextAxis attribute), 87
ASCII (class in openpyxl.descriptors.base), 123 axPos (openpyxl.chart.axis.DateAxis attribute), 82
attribute (openpyxl.descriptors.nested.Nested attribute), axPos (openpyxl.chart.axis.NumericAxis attribute), 84
126 axPos (openpyxl.chart.axis.SeriesAxis attribute), 86
attribute (openpyxl.descriptors.sequence.ValueSequence axPos (openpyxl.chart.axis.TextAxis attribute), 87
attribute), 127
author (openpyxl.comments.author.AuthorList attribute), B
120 b (openpyxl.cell.text.InlineFont attribute), 79
author (openpyxl.comments.properties.Comment at- b (openpyxl.drawing.colors.RGBPercent attribute), 130
tribute), 121 b (openpyxl.drawing.fill.RelativeRect attribute), 143
authorId (openpyxl.comments.properties.Comment at- b (openpyxl.drawing.shapes.GeomRect attribute), 155
tribute), 121 b (openpyxl.drawing.text.CharacterProperties attribute),
AuthorList (class in openpyxl.comments.author), 120 161
authors (openpyxl.comments.properties.CommentSheet b (openpyxl.styles.fonts.Font attribute), 181
attribute), 121 Backdrop (class in openpyxl.drawing.shapes), 153
auto (openpyxl.chart.axis.DateAxis attribute), 82 backdrop (openpyxl.drawing.shapes.Scene3D attribute),
auto (openpyxl.chart.axis.TextAxis attribute), 86 157
auto (openpyxl.styles.colors.Color attribute), 178 backupFile (openpyxl.workbook.properties.WorkbookProperties
autoCompressPictures (open- attribute), 191
pyxl.workbook.properties.WorkbookProperties backWall (openpyxl.chart.bar_chart.BarChart3D at-
attribute), 191 tribute), 88
autoFill (openpyxl.comments.properties.Properties backWall (openpyxl.chart.chartspace.ChartContainer at-
attribute), 122 tribute), 90
AutoFilter (class in openpyxl.worksheet.filters), 196 backward (openpyxl.chart.trendline.Trendline attribute),
autoFilter (openpyxl.worksheet.protection.SheetProtection 112
attribute), 207 bandFmt (openpyxl.chart.surface_chart.BandFormatList
autoLine (openpyxl.comments.properties.Properties at- attribute), 110
tribute), 122 bandFmts (openpyxl.chart.surface_chart.SurfaceChart at-
AutonumberBullet (class in openpyxl.drawing.text), 161 tribute), 111
autoPageBreaks (openpyxl.worksheet.page.PrintPageSetup bandFmts (openpyxl.chart.surface_chart.SurfaceChart3D
attribute), 203 attribute), 111
autoPageBreaks (openpyxl.worksheet.properties.PageSetupProperties
BandFormat (class in openpyxl.chart.surface_chart), 110
attribute), 205 BandFormatList (class in openpyxl.chart.surface_chart),
autoRepublish (openpyxl.chartsheet.publish.WebPublishItem 110
attribute), 118 bar3DChart (openpyxl.chart.chartspace.PlotArea at-
autoScale (openpyxl.comments.properties.Properties at- tribute), 93
tribute), 122 BarChart (class in openpyxl.chart.bar_chart), 88
autoTitleDeleted (open- barChart (openpyxl.chart.chartspace.PlotArea attribute),
pyxl.chart.chartspace.ChartContainer at- 93
tribute), 90 BarChart3D (class in openpyxl.chart.bar_chart), 88
autoUpdate (openpyxl.chart.chartspace.ExternalData at- barDir (openpyxl.chart.bar_chart.BarChart attribute), 88

Index 237
openpyxl Documentation, Release 2.4.0

barDir (openpyxl.chart.bar_chart.BarChart3D attribute), blurRad (openpyxl.drawing.effect.InnerShadowEffect at-


88 tribute), 135
Base64Binary (class in openpyxl.descriptors.excel), 125 blurRad (openpyxl.drawing.effect.OuterShadowEffect at-
base_date (openpyxl.cell.cell.Cell attribute), 77 tribute), 136
base_date (openpyxl.cell.interface.AbstractCell at- blurRad (openpyxl.drawing.effect.ReflectionEffect
tribute), 78 attribute), 138
base_date (openpyxl.cell.read_only.ReadOnlyCell bmk (openpyxl.drawing.text.CharacterProperties at-
attribute), 79 tribute), 161
baseline (openpyxl.drawing.text.CharacterProperties at- bodyPr (openpyxl.chart.text.RichText attribute), 111
tribute), 161 Bool (class in openpyxl.descriptors.base), 123
baseTimeUnit (openpyxl.chart.axis.DateAxis attribute), Border (class in openpyxl.styles.borders), 177
82 border (openpyxl.cell.read_only.ReadOnlyCell attribute),
bestFit (openpyxl.worksheet.dimensions.ColumnDimension 79
attribute), 195 border (openpyxl.styles.differential.DifferentialStyle at-
Bevel (class in openpyxl.drawing.shapes), 153 tribute), 179
bevel (openpyxl.drawing.line.LineProperties attribute), border (openpyxl.styles.named_styles.NamedStyle
151 attribute), 183
bevelB (openpyxl.drawing.shapes.Shape3D attribute), border (openpyxl.styles.Style attribute), 176
157 border_color (openpyxl.drawing.shape.Shape attribute),
bevelT (openpyxl.drawing.shapes.Shape3D attribute), 153
157 border_width (openpyxl.drawing.shape.Shape attribute),
bg1 (openpyxl.drawing.colors.ColorMapping attribute), 153
129 bottom (openpyxl.formatting.rule.Rule attribute), 172
bg2 (openpyxl.drawing.colors.ColorMapping attribute), bottom (openpyxl.styles.borders.Border attribute), 177
129 bottom (openpyxl.styles.fills.GradientFill attribute), 180
bgClr (openpyxl.drawing.fill.PatternFillProperties at- bottom (openpyxl.worksheet.page.PageMargins at-
tribute), 142 tribute), 202
bgColor (openpyxl.styles.fills.PatternFill attribute), 180 BoundDictionary (class in open-
biLevel (openpyxl.drawing.fill.Blip attribute), 140 pyxl.utils.bound_dictionary), 185
BiLevelEffect (class in openpyxl.drawing.effect), 133 bounding_box() (in module openpyxl.drawing.image),
bIns (openpyxl.drawing.text.RichTextProperties at- 150
tribute), 168 br (openpyxl.drawing.text.Paragraph attribute), 165
blackAndWhite (openpyxl.worksheet.page.PrintPageSetup Break (class in openpyxl.worksheet.pagebreak), 205
attribute), 203 BREAK_COLUMN (open-
blank (openpyxl.worksheet.filters.Filters attribute), 199 pyxl.worksheet.worksheet.Worksheet at-
blend (openpyxl.drawing.effect.FillOverlayEffect at- tribute), 211
tribute), 134 BREAK_NONE (open-
Blip (class in openpyxl.drawing.fill), 139 pyxl.worksheet.worksheet.Worksheet at-
blip (openpyxl.drawing.fill.BlipFillProperties attribute), tribute), 211
141 BREAK_ROW (openpyxl.worksheet.worksheet.Worksheet
blipFill (openpyxl.drawing.graphic.PictureFrame at- attribute), 211
tribute), 149 bright (openpyxl.drawing.effect.LuminanceEffect at-
blipFill (openpyxl.drawing.text.CharacterProperties at- tribute), 136
tribute), 161 brk (openpyxl.worksheet.pagebreak.PageBreak attribute),
BlipFillProperties (class in openpyxl.drawing.fill), 141 205
blue (openpyxl.drawing.colors.SystemColor attribute), buAutoNum (openpyxl.drawing.text.ParagraphProperties
130 attribute), 166
blueMod (openpyxl.drawing.colors.SystemColor at- bubble3D (openpyxl.chart.bubble_chart.BubbleChart at-
tribute), 130 tribute), 89
blueOff (openpyxl.drawing.colors.SystemColor at- bubble3D (openpyxl.chart.marker.DataPoint attribute),
tribute), 130 102
blur (openpyxl.drawing.effect.EffectList attribute), 133 bubble3D (openpyxl.chart.series.Series attribute), 107
blur (openpyxl.drawing.fill.Blip attribute), 140 bubble3D (openpyxl.chart.series.XYSeries attribute), 108
BlurEffect (class in openpyxl.drawing.effect), 133 BubbleChart (class in openpyxl.chart.bubble_chart), 89

238 Index
openpyxl Documentation, Release 2.4.0

bubbleChart (openpyxl.chart.chartspace.PlotArea at- calculate_dimension() (open-


tribute), 93 pyxl.worksheet.read_only.ReadOnlyWorksheet
bubbleScale (openpyxl.chart.bubble_chart.BubbleChart method), 208
attribute), 89 calculate_dimension() (open-
bubbleSize (openpyxl.chart.series.Series attribute), 107 pyxl.worksheet.worksheet.Worksheet method),
bubbleSize (openpyxl.chart.series.XYSeries attribute), 212
108 calendarType (openpyxl.worksheet.filters.Filters at-
buBlip (openpyxl.drawing.text.ParagraphProperties at- tribute), 199
tribute), 166 Camera (class in openpyxl.drawing.shapes), 153
buChar (openpyxl.drawing.text.ParagraphProperties at- camera (openpyxl.drawing.shapes.Scene3D attribute),
tribute), 166 157
buClr (openpyxl.drawing.text.ParagraphProperties cap (openpyxl.drawing.line.LineProperties attribute), 151
attribute), 166 cap (openpyxl.drawing.text.CharacterProperties at-
buClrTx (openpyxl.drawing.text.ParagraphProperties at- tribute), 162
tribute), 166 caseSensitive (openpyxl.worksheet.filters.SortState at-
buFont (openpyxl.drawing.text.ParagraphProperties at- tribute), 200
tribute), 166 cat (openpyxl.chart.series.Series attribute), 107
buFontTx (openpyxl.drawing.text.ParagraphProperties at- catAx (openpyxl.chart.chartspace.PlotArea attribute), 93
tribute), 166 Cell (class in openpyxl.cell.cell), 77
builtin_format_code() (in module open- cell() (openpyxl.worksheet.worksheet.Worksheet
pyxl.styles.numbers), 183 method), 212
builtin_format_id() (in module openpyxl.styles.numbers), cell() (openpyxl.writer.write_only.WriteOnlyWorksheet
183 method), 215
builtinId (openpyxl.styles.named_styles.NamedCellStyle CELL_TAG (openpyxl.reader.worksheet.WorkSheetParser
attribute), 182 attribute), 175
builtinId (openpyxl.styles.named_styles.NamedStyle at- cellColor (openpyxl.worksheet.filters.ColorFilter at-
tribute), 183 tribute), 197
builtInUnit (openpyxl.chart.axis.DisplayUnitsLabelList cellComments (openpyxl.worksheet.page.PrintPageSetup
attribute), 84 attribute), 203
buNone (openpyxl.drawing.text.ParagraphProperties at- CellCoordinatesException, 186
tribute), 166 CellIsRule() (in module openpyxl.formatting.rule), 170
buSzPct (openpyxl.drawing.text.ParagraphProperties at- CellRange (class in openpyxl.worksheet.filters), 197
tribute), 166 cells (openpyxl.chart.reference.Reference attribute), 105
buSzPts (openpyxl.drawing.text.ParagraphProperties at- cellStyle (openpyxl.styles.named_styles.NamedCellStyleList
tribute), 166 attribute), 182
buSzTx (openpyxl.drawing.text.ParagraphProperties at- CENTER (openpyxl.worksheet.header_footer.HeaderFooterItem
tribute), 166 attribute), 201
bwMode (openpyxl.chart.shapes.GraphicalProperties at- center_footer (openpyxl.worksheet.header_footer.HeaderFooter
tribute), 109 attribute), 201
bwMode (openpyxl.drawing.graphic.GroupShapeProperties center_header (openpyxl.worksheet.header_footer.HeaderFooter
attribute), 146 attribute), 201
cfe (openpyxl.chartsheet.relation.DrawingHF attribute),
C 119
calcCompleted (openpyxl.workbook.properties.CalcProperties cff (openpyxl.chartsheet.relation.DrawingHF attribute),
attribute), 189 119
calcId (openpyxl.workbook.properties.CalcProperties at- cfo (openpyxl.chartsheet.relation.DrawingHF attribute),
tribute), 189 119
calcMode (openpyxl.workbook.properties.CalcProperties cfvo (openpyxl.formatting.rule.RuleType attribute), 173
attribute), 189 CharacterProperties (class in openpyxl.drawing.text), 161
calcOnSave (openpyxl.workbook.properties.CalcProperties charset (openpyxl.cell.text.InlineFont attribute), 80
attribute), 189 charset (openpyxl.drawing.text.Font attribute), 163
CalcProperties (class in openpyxl.workbook.properties), charset (openpyxl.styles.fonts.Font attribute), 181
189 chart (openpyxl.chart.chartspace.ChartSpace attribute),
91

Index 239
openpyxl Documentation, Release 2.4.0

chart (openpyxl.drawing.graphic.GraphicData attribute), clrMapOvr (openpyxl.chart.chartspace.ChartSpace


144 attribute), 91
ChartContainer (class in openpyxl.chart.chartspace), 90 clrRepl (openpyxl.drawing.fill.Blip attribute), 140
ChartLines (class in openpyxl.chart.axis), 82 clrTo (openpyxl.drawing.effect.ColorChangeEffect at-
chartObject (openpyxl.chart.chartspace.Protection at- tribute), 133
tribute), 94 cm_to_dxa() (in module openpyxl.utils.units), 187
ChartRelation (class in openpyxl.drawing.graphic), 144 cm_to_EMU() (in module openpyxl.utils.units), 187
Chartsheet (class in openpyxl.chartsheet.chartsheet), 116 cmpd (openpyxl.drawing.line.LineProperties attribute),
Chartsheet() (in module open- 151
pyxl.chartsheet.tests.test_chartsheet), 114 cNvCxnSpPr (openpyxl.drawing.graphic.ConnectorNonVisual
ChartsheetProperties (class in open- attribute), 144
pyxl.chartsheet.properties), 117 cNvGraphicFramePr (open-
ChartsheetProperties() (in module open- pyxl.drawing.graphic.NonVisualGraphicFrame
pyxl.chartsheet.tests.test_properties), 114 attribute), 148
ChartsheetProtection (class in open- cNvGrpSpPr (openpyxl.drawing.graphic.NonVisualGroupShape
pyxl.chartsheet.protection), 117 attribute), 148
ChartsheetProtection() (in module open- cNvPicPr (openpyxl.drawing.graphic.PictureNonVisual
pyxl.chartsheet.tests.test_protection), 115 attribute), 150
chartsheets (openpyxl.workbook.workbook.Workbook at- cNvPr (openpyxl.drawing.graphic.ConnectorNonVisual
tribute), 192 attribute), 144
ChartsheetView (class in openpyxl.chartsheet.views), 120 cNvPr (openpyxl.drawing.graphic.NonVisualGraphicFrame
ChartsheetView() (in module open- attribute), 148
pyxl.chartsheet.tests.test_views), 115 cNvPr (openpyxl.drawing.graphic.NonVisualGroupShape
ChartsheetViewList (class in openpyxl.chartsheet.views), attribute), 148
120 cNvPr (openpyxl.drawing.graphic.PictureNonVisual at-
ChartsheetViewList() (in module open- tribute), 150
pyxl.chartsheet.tests.test_views), 115 codeName (openpyxl.chartsheet.properties.ChartsheetProperties
ChartSpace (class in openpyxl.chart.chartspace), 91 attribute), 117
che (openpyxl.chartsheet.relation.DrawingHF attribute), codeName (openpyxl.workbook.properties.FileVersion
119 attribute), 190
check_error() (openpyxl.cell.cell.Cell method), 77 codeName (openpyxl.workbook.properties.WorkbookProperties
check_string() (openpyxl.cell.cell.Cell method), 78 attribute), 191
checkCompatibility (open- codeName (openpyxl.worksheet.properties.WorksheetProperties
pyxl.workbook.properties.WorkbookProperties attribute), 206
attribute), 191 col (openpyxl.drawing.spreadsheet_drawing.AnchorMarker
chExt (openpyxl.drawing.graphic.GroupTransform2D at- attribute), 159
tribute), 146 col_idx (openpyxl.cell.cell.Cell attribute), 78
chf (openpyxl.chartsheet.relation.DrawingHF attribute), colHidden (openpyxl.comments.properties.Properties at-
119 tribute), 122
cho (openpyxl.chartsheet.relation.DrawingHF attribute), colId (openpyxl.worksheet.filters.FilterColumn attribute),
119 198
chOff (openpyxl.drawing.graphic.GroupTransform2D at- collapse_cell_addresses() (in module open-
tribute), 146 pyxl.worksheet.datavalidation), 194
clientData (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor
collapsed (openpyxl.worksheet.dimensions.ColumnDimension
attribute), 159 attribute), 195
clientData (openpyxl.drawing.spreadsheet_drawing.OneCellAnchor
collapsed (openpyxl.worksheet.dimensions.Dimension
attribute), 159 attribute), 195
clientData (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor
collection (openpyxl.styles.styleable.NumberFormatDescriptor
attribute), 160 attribute), 184
close() (openpyxl.writer.write_only.WriteOnlyWorksheet colOff (openpyxl.drawing.spreadsheet_drawing.AnchorMarker
method), 215 attribute), 159
clrChange (openpyxl.drawing.fill.Blip attribute), 140 Color (class in openpyxl.drawing.effect), 133
clrFrom (openpyxl.drawing.effect.ColorChangeEffect at- Color (class in openpyxl.styles.colors), 178
tribute), 133 color (openpyxl.cell.text.InlineFont attribute), 80

240 Index
openpyxl Documentation, Release 2.4.0

color (openpyxl.drawing.shape.Shape attribute), 153 121


color (openpyxl.formatting.rule.ColorScale attribute), CommentWriter (class in openpyxl.comments.writer),
170 123
color (openpyxl.formatting.rule.DataBar attribute), 171 comp (openpyxl.drawing.colors.SystemColor attribute),
color (openpyxl.styles.borders.Side attribute), 178 130
color (openpyxl.styles.colors.MRUColorList attribute), compatLnSpc (openpyxl.drawing.text.RichTextProperties
179 attribute), 168
color (openpyxl.styles.fonts.Font attribute), 181 concurrentCalc (openpyxl.workbook.properties.CalcProperties
ColorChangeEffect (class in openpyxl.drawing.effect), attribute), 190
133 concurrentManualCount (open-
ColorChoice (class in openpyxl.drawing.colors), 128 pyxl.workbook.properties.CalcProperties
ColorChoiceDescriptor (class in open- attribute), 190
pyxl.drawing.colors), 128 condense (openpyxl.cell.text.InlineFont attribute), 80
ColorDescriptor (class in openpyxl.styles.colors), 179 condense (openpyxl.styles.fonts.Font attribute), 181
ColorFilter (class in openpyxl.worksheet.filters), 197 ConditionalElement() (in module open-
colorFilter (openpyxl.worksheet.filters.FilterColumn at- pyxl.xml.functions), 216
tribute), 198 ConditionalFormatting (class in open-
colorId (openpyxl.worksheet.views.SheetView attribute), pyxl.formatting.formatting), 170
209 Connection (class in openpyxl.drawing.graphic), 144
ColorList (class in openpyxl.styles.colors), 179 ConnectionSite (class in openpyxl.drawing.shapes), 154
ColorMapping (class in openpyxl.drawing.colors), 129 ConnectionSiteList (class in openpyxl.drawing.shapes),
ColorReplaceEffect (class in openpyxl.drawing.effect), 154
133 Connector (class in openpyxl.drawing.graphic), 144
ColorScale (class in openpyxl.formatting.rule), 170 ConnectorLocking (class in openpyxl.drawing.graphic),
colorScale (openpyxl.formatting.rule.Rule attribute), 172 144
ColorScaleRule() (in module openpyxl.formatting.rule), ConnectorNonVisual (class in open-
170 pyxl.drawing.graphic), 144
cols (openpyxl.chart.reference.Reference attribute), 105 cont (openpyxl.drawing.effect.AlphaModulateEffect at-
cols_from_range() (in module openpyxl.utils), 185 tribute), 132
column (openpyxl.cell.cell.Cell attribute), 78 content (openpyxl.cell.text.Text attribute), 81
column (openpyxl.cell.read_only.ReadOnlyCell at- content (openpyxl.chartsheet.protection.ChartsheetProtection
tribute), 79 attribute), 118
column_index_from_string() (in module openpyxl.utils), content (openpyxl.comments.properties.Comment at-
185 tribute), 121
ColumnDimension (class in open- contentPart (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor
pyxl.worksheet.dimensions), 195 attribute), 159
columns (openpyxl.worksheet.read_only.ReadOnlyWorksheet contentPart (openpyxl.drawing.spreadsheet_drawing.OneCellAnchor
attribute), 208 attribute), 160
columns (openpyxl.worksheet.worksheet.Worksheet at- contentPart (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor
tribute), 212 attribute), 160
columnSort (openpyxl.worksheet.filters.SortState at- ContentType (openpyxl.packaging.manifest.FileExtension
tribute), 200 attribute), 173
Comment (class in openpyxl.comments.comments), 121 ContentType (openpyxl.packaging.manifest.Override at-
Comment (class in openpyxl.comments.properties), 121 tribute), 173
comment (openpyxl.cell.cell.Cell attribute), 78 contourClr (openpyxl.drawing.shapes.Shape3D at-
comment (openpyxl.cell.interface.AbstractCell attribute), tribute), 157
78 contourW (openpyxl.drawing.shapes.Shape3D attribute),
comment_writer (openpyxl.writer.excel.ExcelWriter at- 157
tribute), 214 contrast (openpyxl.drawing.effect.LuminanceEffect at-
commentList (openpyxl.comments.properties.CommentSheet tribute), 136
attribute), 121 Convertible (class in openpyxl.descriptors.base), 123
commentPr (openpyxl.comments.properties.Comment at- coordinate (openpyxl.cell.cell.Cell attribute), 78
tribute), 121 coordinate (openpyxl.cell.interface.AbstractCell at-
CommentSheet (class in openpyxl.comments.properties), tribute), 78

Index 241
openpyxl Documentation, Release 2.4.0

coordinate (openpyxl.cell.read_only.ReadOnlyCell custDash (openpyxl.drawing.line.LineProperties at-


attribute), 79 tribute), 151
coordinate_from_string() (in module openpyxl.utils), 185 custGeom (openpyxl.chart.shapes.GraphicalProperties at-
coordinate_to_tuple() (in module openpyxl.utils), 185 tribute), 109
coordinates (openpyxl.drawing.shape.Shape attribute), customBuiltin (openpyxl.styles.named_styles.NamedCellStyle
153 attribute), 182
copies (openpyxl.worksheet.page.PrintPageSetup at- CustomChartsheetView (class in open-
tribute), 203 pyxl.chartsheet.custom), 116
copy() (openpyxl.styles.hashable.HashableObject CustomChartsheetView() (in module open-
method), 182 pyxl.chartsheet.tests.test_custom), 114
copy() (openpyxl.styles.proxy.StyleProxy method), 184 CustomChartsheetViews (class in open-
copy() (openpyxl.styles.Style method), 176 pyxl.chartsheet.custom), 117
count (openpyxl.chartsheet.publish.WebPublishItems at- CustomChartsheetViews() (in module open-
tribute), 118 pyxl.chartsheet.tests.test_custom), 114
count (openpyxl.descriptors.sequence.NestedSequence CustomFilter (class in openpyxl.worksheet.filters), 197
attribute), 127 customFilter (openpyxl.worksheet.filters.CustomFilters
count (openpyxl.drawing.drawing.Drawing attribute), attribute), 197
132 CustomFilters (class in openpyxl.worksheet.filters), 197
count (openpyxl.styles.named_styles.NamedCellStyleList customFilters (openpyxl.worksheet.filters.FilterColumn
attribute), 182 attribute), 198
count (openpyxl.styles.numbers.NumberFormatList at- customFormat (openpyxl.worksheet.dimensions.RowDimension
tribute), 183 attribute), 196
count (openpyxl.worksheet.datavalidation.DataValidationListCustomGeometry2D (class in openpyxl.drawing.shapes),
attribute), 194 154
count (openpyxl.worksheet.pagebreak.PageBreak at- customHeight (openpyxl.worksheet.dimensions.RowDimension
tribute), 205 attribute), 196
create_chartsheet() (open- customList (openpyxl.worksheet.filters.SortCondition at-
pyxl.workbook.workbook.Workbook method), tribute), 199
192 customSheetView (open-
create_named_range() (open- pyxl.chartsheet.custom.CustomChartsheetViews
pyxl.workbook.workbook.Workbook method), attribute), 117
192 customSheetViews (open-
create_sheet() (openpyxl.workbook.workbook.Workbook pyxl.chartsheet.chartsheet.Chartsheet at-
method), 192 tribute), 116
create_temporary_file() (in module open- CustomSplit (class in openpyxl.chart.pie_chart), 103
pyxl.writer.write_only), 216 customWidth (openpyxl.worksheet.dimensions.ColumnDimension
crossAx (openpyxl.chart.axis.DateAxis attribute), 83 attribute), 195
crossAx (openpyxl.chart.axis.NumericAxis attribute), 84 custSplit (openpyxl.chart.pie_chart.ProjectedPieChart at-
crossAx (openpyxl.chart.axis.SeriesAxis attribute), 86 tribute), 104
crossAx (openpyxl.chart.axis.TextAxis attribute), 87 custUnit (openpyxl.chart.axis.DisplayUnitsLabelList at-
crossBetween (openpyxl.chart.axis.NumericAxis at- tribute), 84
tribute), 84 cx (openpyxl.drawing.shapes.PositiveSize2D attribute),
crosses (openpyxl.chart.axis.DateAxis attribute), 83 156
crosses (openpyxl.chart.axis.NumericAxis attribute), 84 cxn (openpyxl.drawing.shapes.ConnectionSiteList
crosses (openpyxl.chart.axis.SeriesAxis attribute), 86 attribute), 154
crosses (openpyxl.chart.axis.TextAxis attribute), 87 cxnLst (openpyxl.drawing.shapes.CustomGeometry2D
crossesAt (openpyxl.chart.axis.DateAxis attribute), 83 attribute), 154
crossesAt (openpyxl.chart.axis.NumericAxis attribute), cxnSp (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor
84 attribute), 159
crossesAt (openpyxl.chart.axis.SeriesAxis attribute), 86 cxnSp (openpyxl.drawing.spreadsheet_drawing.OneCellAnchor
crossesAt (openpyxl.chart.axis.TextAxis attribute), 87 attribute), 160
cs (openpyxl.drawing.text.CharacterProperties attribute), cxnSp (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor
162 attribute), 160
cstate (openpyxl.drawing.fill.Blip attribute), 140 cxnSpLocks (openpyxl.drawing.graphic.NonVisualConnectorProperties

242 Index
openpyxl Documentation, Release 2.4.0

attribute), 147 defaultGridColor (openpyxl.worksheet.views.SheetView


cy (openpyxl.drawing.shapes.PositiveSize2D attribute), attribute), 209
156 defaultSize (openpyxl.comments.properties.Properties at-
tribute), 122
D defaultThemeVersion (open-
d (openpyxl.drawing.line.DashStop attribute), 150 pyxl.workbook.properties.WorkbookProperties
DashStop (class in openpyxl.drawing.line), 150 attribute), 191
DashStopList (class in openpyxl.drawing.line), 150 defPPr (openpyxl.drawing.text.ListStyle attribute), 165
data (openpyxl.chart.chartspace.Protection attribute), 94 defRPr (openpyxl.drawing.text.ParagraphProperties at-
data_only (openpyxl.workbook.workbook.Workbook at- tribute), 166
tribute), 192 defTabSz (openpyxl.drawing.text.ParagraphProperties at-
data_type (openpyxl.cell.cell.Cell attribute), 78 tribute), 166
data_type (openpyxl.cell.read_only.ReadOnlyCell at- degree (openpyxl.styles.fills.GradientFill attribute), 180
tribute), 79 degrees_to_angle() (in module openpyxl.utils.units), 187
DataBar (class in openpyxl.formatting.rule), 170 delete (openpyxl.chart.axis.DateAxis attribute), 83
dataBar (openpyxl.formatting.rule.Rule attribute), 172 delete (openpyxl.chart.axis.NumericAxis attribute), 84
DataBarRule() (in module openpyxl.formatting.rule), 171 delete (openpyxl.chart.axis.SeriesAxis attribute), 86
DataLabel (class in openpyxl.chart.label), 97 delete (openpyxl.chart.axis.TextAxis attribute), 87
DataLabelList (class in openpyxl.chart.label), 98 delete (openpyxl.chart.legend.LegendEntry attribute),
DataPoint (class in openpyxl.chart.marker), 102 100
DataTable (class in openpyxl.chart.chartspace), 91 deleteColumns (openpyxl.worksheet.protection.SheetProtection
DataValidation (class in open- attribute), 207
pyxl.worksheet.datavalidation), 193 deleteRows (openpyxl.worksheet.protection.SheetProtection
dataValidation (openpyxl.worksheet.datavalidation.DataValidationListattribute), 207
attribute), 194 descending (openpyxl.worksheet.filters.SortCondition at-
DataValidationList (class in open- tribute), 199
pyxl.worksheet.datavalidation), 194 descr (openpyxl.drawing.graphic.NonVisualDrawingProps
date1904 (openpyxl.chart.chartspace.ChartSpace at- attribute), 147
tribute), 91 Descriptor (class in openpyxl.descriptors.base), 123
date1904 (openpyxl.workbook.properties.WorkbookProperties destinationFile (openpyxl.chartsheet.publish.WebPublishItem
attribute), 191 attribute), 118
dateAx (openpyxl.chart.chartspace.PlotArea attribute), 93 destinations (openpyxl.workbook.names.named_range.NamedRange
DateAxis (class in openpyxl.chart.axis), 82 attribute), 188
dateCompatibility (open- detect_external_links() (in module open-
pyxl.workbook.properties.WorkbookProperties pyxl.workbook.names.external), 188
attribute), 191 diagonal (openpyxl.styles.borders.Border attribute), 177
DateGroupItem (class in openpyxl.worksheet.filters), 198 diagonalDown (openpyxl.styles.borders.Border at-
dateGroupItem (openpyxl.worksheet.filters.Filters at- tribute), 177
tribute), 199 diagonalUp (openpyxl.styles.borders.Border attribute),
DateTime (class in openpyxl.descriptors.base), 123 177
datetime_to_W3CDTF() (in module open- DifferentialStyle (class in openpyxl.styles.differential),
pyxl.utils.datetime), 185 179
dateTimeGrouping (open- Dimension (class in openpyxl.worksheet.dimensions),
pyxl.worksheet.filters.DateGroupItem at- 195
tribute), 198 DimensionHolder (class in open-
day (openpyxl.worksheet.filters.DateGroupItem at- pyxl.worksheet.dimensions), 196
tribute), 198 dimensions (openpyxl.worksheet.worksheet.Worksheet
days_to_time() (in module openpyxl.utils.datetime), 186 attribute), 212
Default (class in openpyxl.descriptors.base), 123 dir (openpyxl.drawing.effect.InnerShadowEffect at-
Default (openpyxl.packaging.manifest.Manifest at- tribute), 135
tribute), 173 dir (openpyxl.drawing.effect.OuterShadowEffect at-
DEFAULT_HEADER (in module openpyxl.utils.units), tribute), 136
187 dir (openpyxl.drawing.effect.PresetShadowEffect at-
tribute), 137

Index 243
openpyxl Documentation, Release 2.4.0

dir (openpyxl.drawing.effect.ReflectionEffect attribute), dLbls (openpyxl.chart.pie_chart.PieChart attribute), 104


138 dLbls (openpyxl.chart.pie_chart.PieChart3D attribute),
dir (openpyxl.drawing.shapes.LightRig attribute), 155 104
dirty (openpyxl.drawing.text.CharacterProperties at- dLbls (openpyxl.chart.pie_chart.ProjectedPieChart
tribute), 162 attribute), 104
disable() (openpyxl.worksheet.protection.SheetProtection dLbls (openpyxl.chart.radar_chart.RadarChart attribute),
method), 207 105
disabled (openpyxl.comments.properties.Properties at- dLbls (openpyxl.chart.scatter_chart.ScatterChart at-
tribute), 122 tribute), 106
disablePrompts (openpyxl.worksheet.datavalidation.DataValidationList
dLbls (openpyxl.chart.series.Series attribute), 107
attribute), 194 dLbls (openpyxl.chart.series.XYSeries attribute), 108
dispBlanksAs (openpyxl.chart.chartspace.ChartContainer dLbls (openpyxl.chart.stock_chart.StockChart attribute),
attribute), 90 110
dispEq (openpyxl.chart.trendline.Trendline attribute), 112 DoughnutChart (class in openpyxl.chart.pie_chart), 103
display (openpyxl.worksheet.hyperlink.Hyperlink at- doughnutChart (openpyxl.chart.chartspace.PlotArea at-
tribute), 202 tribute), 93
DisplayUnitsLabel (class in openpyxl.chart.axis), 83 downBars (openpyxl.chart.updown_bars.UpDownBars
DisplayUnitsLabelList (class in openpyxl.chart.axis), 84 attribute), 113
dispRSqr (openpyxl.chart.trendline.Trendline attribute), dpi (openpyxl.drawing.fill.BlipFillProperties attribute),
112 141
dispUnits (openpyxl.chart.axis.NumericAxis attribute), dPt (openpyxl.chart.series.Series attribute), 107
84 dPt (openpyxl.chart.series.XYSeries attribute), 108
dispUnitsLbl (openpyxl.chart.axis.DisplayUnitsLabelList draft (openpyxl.worksheet.page.PrintPageSetup at-
attribute), 84 tribute), 203
dist (openpyxl.drawing.effect.InnerShadowEffect at- Drawing (class in openpyxl.drawing.drawing), 132
tribute), 135 Drawing (class in openpyxl.worksheet.drawing), 196
dist (openpyxl.drawing.effect.OuterShadowEffect at- drawing (openpyxl.chartsheet.chartsheet.Chartsheet at-
tribute), 136 tribute), 116
dist (openpyxl.drawing.effect.PresetShadowEffect DrawingHF (class in openpyxl.chartsheet.relation), 119
attribute), 137 drawingHF (openpyxl.chartsheet.chartsheet.Chartsheet
dist (openpyxl.drawing.effect.ReflectionEffect attribute), attribute), 116
139 DrawingHF() (in module open-
divId (openpyxl.chartsheet.publish.WebPublishItem at- pyxl.chartsheet.tests.test_relation), 115
tribute), 118 dropLines (openpyxl.chart.area_chart.AreaChart at-
dLbl (openpyxl.chart.chartspace.PivotFormat attribute), tribute), 81
92 dropLines (openpyxl.chart.area_chart.AreaChart3D at-
dLbl (openpyxl.chart.label.DataLabelList attribute), 98 tribute), 82
dLblPos (openpyxl.chart.label.DataLabel attribute), 97 dropLines (openpyxl.chart.line_chart.LineChart at-
dLblPos (openpyxl.chart.label.DataLabelList attribute), tribute), 101
98 dropLines (openpyxl.chart.line_chart.LineChart3D
dLbls (openpyxl.chart.area_chart.AreaChart attribute), 81 attribute), 101
dLbls (openpyxl.chart.area_chart.AreaChart3D attribute), dropLines (openpyxl.chart.stock_chart.StockChart
82 attribute), 110
dLbls (openpyxl.chart.bar_chart.BarChart attribute), 88 ds (openpyxl.drawing.line.DashStopList attribute), 150
dLbls (openpyxl.chart.bar_chart.BarChart3D attribute), dst() (openpyxl.utils.datetime.GMT method), 185
88 dTable (openpyxl.chart.chartspace.PlotArea attribute), 93
dLbls (openpyxl.chart.bubble_chart.BubbleChart at- DummyWorkbook (class in open-
tribute), 89 pyxl.chartsheet.tests.test_chartsheet), 114
dLbls (openpyxl.chart.line_chart.LineChart attribute), DummyWorksheet (class in openpyxl.chart.reference),
100 105
dLbls (openpyxl.chart.line_chart.LineChart3D attribute), duotone (openpyxl.drawing.fill.Blip attribute), 140
101 DuotoneEffect (class in openpyxl.drawing.effect), 133
dLbls (openpyxl.chart.pie_chart.DoughnutChart at- dx (openpyxl.drawing.shapes.Vector3D attribute), 158
tribute), 103 dxa_to_cm() (in module openpyxl.utils.units), 187

244 Index
openpyxl Documentation, Release 2.4.0

dxa_to_inch() (in module openpyxl.utils.units), 187 equalAverage (openpyxl.formatting.rule.Rule attribute),


dxf (openpyxl.formatting.rule.Rule attribute), 172 172
dxfId (openpyxl.formatting.rule.Rule attribute), 172 err (openpyxl.drawing.text.CharacterProperties attribute),
dxfId (openpyxl.worksheet.filters.ColorFilter attribute), 162
197 errBars (openpyxl.chart.series.Series attribute), 107
dxfId (openpyxl.worksheet.filters.SortCondition at- errBars (openpyxl.chart.series.XYSeries attribute), 108
tribute), 199 errBarType (openpyxl.chart.error_bar.ErrorBars at-
dy (openpyxl.drawing.shapes.Vector3D attribute), 158 tribute), 97
DynamicFilter (class in openpyxl.worksheet.filters), 198 errDir (openpyxl.chart.error_bar.ErrorBars attribute), 97
dynamicFilter (openpyxl.worksheet.filters.FilterColumn error (openpyxl.worksheet.datavalidation.DataValidation
attribute), 199 attribute), 193
dz (openpyxl.drawing.shapes.Vector3D attribute), 158 ERROR_CODES (openpyxl.cell.cell.Cell attribute), 77
ErrorBars (class in openpyxl.chart.error_bar), 97
E errors (openpyxl.worksheet.page.PrintPageSetup at-
ea (openpyxl.drawing.text.CharacterProperties attribute), tribute), 204
162 errorStyle (openpyxl.worksheet.datavalidation.DataValidation
eaLnBrk (openpyxl.drawing.text.ParagraphProperties at- attribute), 193
tribute), 166 errorTitle (openpyxl.worksheet.datavalidation.DataValidation
eb (openpyxl.cell.text.PhoneticText attribute), 80 attribute), 194
editAs (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor errValType (openpyxl.chart.error_bar.ErrorBars at-
attribute), 160 tribute), 97
EffectContainer (class in openpyxl.drawing.effect), 133 ExcelWriter (class in openpyxl.writer.excel), 214
effectDag (openpyxl.drawing.text.CharacterProperties at- expand_cell_ranges() (in module open-
tribute), 162 pyxl.worksheet.datavalidation), 195
EffectList (class in openpyxl.drawing.effect), 133 expected_type (openpyxl.chart.descriptors.NumberFormatDescriptor
effectLst (openpyxl.drawing.text.CharacterProperties at- attribute), 97
tribute), 162 expected_type (openpyxl.chart.title.TitleDescriptor at-
effectRef (openpyxl.drawing.shapes.ShapeStyle at- tribute), 112
tribute), 157 expected_type (openpyxl.descriptors.base.ASCII at-
embed (openpyxl.drawing.fill.Blip attribute), 140 tribute), 123
EmbeddedWAVAudioFile (class in open- expected_type (openpyxl.descriptors.base.Bool attribute),
pyxl.drawing.text), 163 123
EmptyTag (class in openpyxl.descriptors.nested), 126 expected_type (openpyxl.descriptors.base.DateTime at-
EMU_to_cm() (in module openpyxl.utils.units), 187 tribute), 123
EMU_to_inch() (in module openpyxl.utils.units), 187 expected_type (openpyxl.descriptors.base.Float at-
EMU_to_pixels() (in module openpyxl.utils.units), 187 tribute), 124
enable() (openpyxl.worksheet.protection.SheetProtection expected_type (openpyxl.descriptors.base.Integer at-
method), 207 tribute), 124
enableFormatConditionsCalculation (open- expected_type (openpyxl.descriptors.base.Max attribute),
pyxl.worksheet.properties.WorksheetProperties 124
attribute), 206 expected_type (openpyxl.descriptors.base.Min attribute),
encoding (openpyxl.cell.cell.Cell attribute), 78 124
encoding (openpyxl.cell.interface.AbstractCell attribute), expected_type (openpyxl.descriptors.base.String at-
78 tribute), 124
end (openpyxl.styles.borders.Border attribute), 177 expected_type (openpyxl.descriptors.base.Tuple at-
endA (openpyxl.drawing.effect.ReflectionEffect at- tribute), 124
tribute), 139 expected_type (openpyxl.descriptors.base.Typed at-
endCxn (openpyxl.drawing.graphic.NonVisualConnectorProperties tribute), 125
attribute), 147 expected_type (openpyxl.descriptors.excel.TextPoint at-
endParaRPr (openpyxl.drawing.text.Paragraph attribute), tribute), 125
165 expected_type (openpyxl.descriptors.sequence.Sequence
endPos (openpyxl.drawing.effect.ReflectionEffect at- attribute), 127
tribute), 139 expected_type (openpyxl.drawing.colors.ColorChoiceDescriptor
endSnd (openpyxl.drawing.text.Hyperlink attribute), 164 attribute), 129

Index 245
openpyxl Documentation, Release 2.4.0

expected_type (openpyxl.styles.colors.ColorDescriptor extLst (openpyxl.chart.chartspace.DataTable attribute),


attribute), 179 91
expected_type (openpyxl.styles.colors.RGB attribute), extLst (openpyxl.chart.chartspace.PivotFormat attribute),
179 92
expected_type (openpyxl.worksheet.filters.CellRange at- extLst (openpyxl.chart.chartspace.PivotSource attribute),
tribute), 197 92
explosion (openpyxl.chart.marker.DataPoint attribute), extLst (openpyxl.chart.chartspace.PlotArea attribute), 93
102 extLst (openpyxl.chart.data_source.NumData attribute),
explosion (openpyxl.chart.series.Series attribute), 107 95
ext (openpyxl.descriptors.excel.ExtensionList attribute), extLst (openpyxl.chart.data_source.NumRef attribute), 95
125 extLst (openpyxl.chart.data_source.StrData attribute), 96
ext (openpyxl.drawing.graphic.GroupTransform2D at- extLst (openpyxl.chart.data_source.StrRef attribute), 96
tribute), 147 extLst (openpyxl.chart.error_bar.ErrorBars attribute), 97
ext (openpyxl.drawing.shapes.Transform2D attribute), extLst (openpyxl.chart.label.DataLabel attribute), 98
158 extLst (openpyxl.chart.label.DataLabelList attribute), 98
ext (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor extLst (openpyxl.chart.layout.Layout attribute), 99
attribute), 159 extLst (openpyxl.chart.layout.ManualLayout attribute),
ext (openpyxl.drawing.spreadsheet_drawing.OneCellAnchor 99
attribute), 160 extLst (openpyxl.chart.legend.Legend attribute), 100
extend (openpyxl.cell.text.InlineFont attribute), 80 extLst (openpyxl.chart.legend.LegendEntry attribute),
extend (openpyxl.styles.fonts.Font attribute), 181 100
Extension (class in openpyxl.descriptors.excel), 125 extLst (openpyxl.chart.line_chart.LineChart attribute),
Extension (openpyxl.packaging.manifest.FileExtension 101
attribute), 173 extLst (openpyxl.chart.line_chart.LineChart3D attribute),
ExtensionList (class in openpyxl.descriptors.excel), 125 101
extensions (openpyxl.packaging.manifest.Manifest extLst (openpyxl.chart.marker.DataPoint attribute), 102
attribute), 173 extLst (openpyxl.chart.marker.Marker attribute), 102
external_range() (in module open- extLst (openpyxl.chart.pie_chart.DoughnutChart at-
pyxl.workbook.names.named_range), 189 tribute), 103
ExternalBook (class in open- extLst (openpyxl.chart.pie_chart.PieChart attribute), 104
pyxl.workbook.names.external), 188 extLst (openpyxl.chart.pie_chart.PieChart3D attribute),
ExternalData (class in openpyxl.chart.chartspace), 92 104
externalData (openpyxl.chart.chartspace.ChartSpace at- extLst (openpyxl.chart.pie_chart.ProjectedPieChart at-
tribute), 91 tribute), 104
ExternalRange (class in open- extLst (openpyxl.chart.radar_chart.RadarChart attribute),
pyxl.workbook.names.external), 188 105
extLst (openpyxl.chart.area_chart.AreaChart attribute), extLst (openpyxl.chart.scatter_chart.ScatterChart at-
81 tribute), 106
extLst (openpyxl.chart.axis.DateAxis attribute), 83 extLst (openpyxl.chart.series.Series attribute), 107
extLst (openpyxl.chart.axis.DisplayUnitsLabelList extLst (openpyxl.chart.shapes.GraphicalProperties
attribute), 84 attribute), 109
extLst (openpyxl.chart.axis.NumericAxis attribute), 84 extLst (openpyxl.chart.stock_chart.StockChart attribute),
extLst (openpyxl.chart.axis.Scaling attribute), 85 110
extLst (openpyxl.chart.axis.SeriesAxis attribute), 86 extLst (openpyxl.chart.surface_chart.SurfaceChart
extLst (openpyxl.chart.axis.TextAxis attribute), 87 attribute), 111
extLst (openpyxl.chart.bar_chart.BarChart attribute), 88 extLst (openpyxl.chart.surface_chart.SurfaceChart3D at-
extLst (openpyxl.chart.bar_chart.BarChart3D attribute), tribute), 111
88 extLst (openpyxl.chart.title.Title attribute), 112
extLst (openpyxl.chart.bubble_chart.BubbleChart at- extLst (openpyxl.chart.trendline.Trendline attribute), 112
tribute), 89 extLst (openpyxl.chart.trendline.TrendlineLabel at-
extLst (openpyxl.chart.chartspace.ChartContainer at- tribute), 113
tribute), 90 extLst (openpyxl.chart.updown_bars.UpDownBars
extLst (openpyxl.chart.chartspace.ChartSpace attribute), attribute), 113
91 extLst (openpyxl.chartsheet.chartsheet.Chartsheet at-

246 Index
openpyxl Documentation, Release 2.4.0

tribute), 116 200


extLst (openpyxl.chartsheet.views.ChartsheetView extrusionClr (openpyxl.drawing.shapes.Shape3D at-
attribute), 120 tribute), 157
extLst (openpyxl.chartsheet.views.ChartsheetViewList extrusionH (openpyxl.drawing.shapes.Shape3D at-
attribute), 120 tribute), 157
extLst (openpyxl.comments.properties.CommentSheet extrusionOk (openpyxl.drawing.shapes.Path2D attribute),
attribute), 121 155
extLst (openpyxl.drawing.colors.ColorMapping at-
tribute), 129 F
extLst (openpyxl.drawing.fill.Blip attribute), 140 f (openpyxl.chart.data_source.NumRef attribute), 96
extLst (openpyxl.drawing.graphic.ConnectorLocking at- f (openpyxl.chart.data_source.StrRef attribute), 96
tribute), 144 fadeDir (openpyxl.drawing.effect.ReflectionEffect
extLst (openpyxl.drawing.graphic.GraphicFrameLocking attribute), 139
attribute), 145 family (openpyxl.cell.text.InlineFont attribute), 80
extLst (openpyxl.drawing.graphic.GroupLocking at- family (openpyxl.styles.fonts.Font attribute), 181
tribute), 146 fgClr (openpyxl.drawing.fill.PatternFillProperties at-
extLst (openpyxl.drawing.graphic.GroupShapeProperties tribute), 142
attribute), 146 fgColor (openpyxl.styles.fills.PatternFill attribute), 180
extLst (openpyxl.drawing.graphic.NonVisualConnectorProperties
FileExtension (class in openpyxl.packaging.manifest),
attribute), 147 173
extLst (openpyxl.drawing.graphic.NonVisualDrawingProps filename (openpyxl.writer.write_only.WriteOnlyWorksheet
attribute), 147 attribute), 215
extLst (openpyxl.drawing.graphic.NonVisualGraphicFrameProperties
filenames (openpyxl.packaging.manifest.Manifest at-
attribute), 148 tribute), 173
extLst (openpyxl.drawing.graphic.NonVisualGroupDrawingShapeProps
FileVersion (class in openpyxl.workbook.properties), 190
attribute), 148 Fill (class in openpyxl.styles.fills), 180
extLst (openpyxl.drawing.graphic.NonVisualPictureProperties fill (openpyxl.cell.read_only.ReadOnlyCell attribute), 79
attribute), 148 fill (openpyxl.drawing.shapes.Path2D attribute), 155
extLst (openpyxl.drawing.graphic.PictureLocking at- fill (openpyxl.styles.differential.DifferentialStyle at-
tribute), 149 tribute), 179
extLst (openpyxl.drawing.line.LineProperties attribute), fill (openpyxl.styles.named_styles.NamedStyle attribute),
151 183
extLst (openpyxl.drawing.shapes.Backdrop attribute), fill (openpyxl.styles.Style attribute), 176
153 fillOverlay (openpyxl.drawing.effect.EffectList attribute),
extLst (openpyxl.drawing.shapes.Scene3D attribute), 157 133
extLst (openpyxl.drawing.shapes.Shape3D attribute), 157 fillOverlay (openpyxl.drawing.fill.Blip attribute), 140
extLst (openpyxl.drawing.text.CharacterProperties FillOverlayEffect (class in openpyxl.drawing.effect), 134
attribute), 162 fillRect (openpyxl.drawing.fill.StretchInfoProperties at-
extLst (openpyxl.drawing.text.Hyperlink attribute), 164 tribute), 143
extLst (openpyxl.drawing.text.ListStyle attribute), 165 fillRef (openpyxl.drawing.shapes.ShapeStyle attribute),
extLst (openpyxl.drawing.text.ParagraphProperties 157
attribute), 166 fillToRect (openpyxl.drawing.fill.PathShadeProperties at-
extLst (openpyxl.drawing.text.RichTextProperties at- tribute), 142
tribute), 168 filter (openpyxl.worksheet.filters.Filters attribute), 199
extLst (openpyxl.formatting.rule.FormatObject attribute), FilterColumn (class in openpyxl.worksheet.filters), 198
171 filterColumn (openpyxl.worksheet.filters.AutoFilter at-
extLst (openpyxl.formatting.rule.Rule attribute), 172 tribute), 197
extLst (openpyxl.styles.named_styles.NamedCellStyle filterMode (openpyxl.worksheet.properties.WorksheetProperties
attribute), 182 attribute), 206
extLst (openpyxl.worksheet.filters.AutoFilter attribute), filterPrivacy (openpyxl.workbook.properties.WorkbookProperties
197 attribute), 191
extLst (openpyxl.worksheet.filters.FilterColumn at- Filters (class in openpyxl.worksheet.filters), 199
tribute), 199 filters (openpyxl.worksheet.filters.FilterColumn at-
extLst (openpyxl.worksheet.filters.SortState attribute), tribute), 199

Index 247
openpyxl Documentation, Release 2.4.0

filterVal (openpyxl.worksheet.filters.Top10 attribute), 200 font_color (openpyxl.worksheet.header_footer.HeaderFooterItem


firstPageNumber (open- attribute), 202
pyxl.worksheet.page.PrintPageSetup attribute), FONT_HEIGHT (openpyxl.drawing.shape.Shape at-
204 tribute), 152
firstSliceAng (openpyxl.chart.pie_chart.DoughnutChart font_name (openpyxl.worksheet.header_footer.HeaderFooterItem
attribute), 103 attribute), 202
firstSliceAng (openpyxl.chart.pie_chart.PieChart at- font_size (openpyxl.worksheet.header_footer.HeaderFooterItem
tribute), 104 attribute), 202
fitToHeight (openpyxl.worksheet.page.PrintPageSetup at- FONT_WIDTH (openpyxl.drawing.shape.Shape at-
tribute), 204 tribute), 152
fitToPage (openpyxl.worksheet.page.PrintPageSetup at- fontAlgn (openpyxl.drawing.text.ParagraphProperties at-
tribute), 204 tribute), 166
fitToPage (openpyxl.worksheet.properties.PageSetupPropertiesfontId (openpyxl.cell.text.PhoneticProperties attribute),
attribute), 205 80
fitToWidth (openpyxl.worksheet.page.PrintPageSetup at- fontRef (openpyxl.drawing.shapes.ShapeStyle attribute),
tribute), 204 158
flatten() (in module openpyxl.worksheet.worksheet), 213 FontReference (class in openpyxl.drawing.shapes), 154
flatTx (openpyxl.drawing.text.RichTextProperties at- fontScale (openpyxl.drawing.text.TextNormalAutofit at-
tribute), 168 tribute), 170
fld (openpyxl.drawing.text.Paragraph attribute), 165 footer (openpyxl.worksheet.page.PageMargins attribute),
flip (openpyxl.drawing.fill.GradientFillProperties at- 202
tribute), 141 forceAA (openpyxl.drawing.text.RichTextProperties at-
flip (openpyxl.drawing.fill.TileInfoProperties attribute), tribute), 168
143 forceFullCalc (openpyxl.workbook.properties.CalcProperties
flipH (openpyxl.drawing.graphic.GroupTransform2D at- attribute), 190
tribute), 147 formatCells (openpyxl.worksheet.protection.SheetProtection
flipH (openpyxl.drawing.shapes.Transform2D attribute), attribute), 207
158 formatCode (openpyxl.chart.data_source.NumData at-
flipV (openpyxl.drawing.graphic.GroupTransform2D at- tribute), 95
tribute), 147 formatCode (openpyxl.chart.data_source.NumFmt
flipV (openpyxl.drawing.shapes.Transform2D attribute), attribute), 95
158 formatCode (openpyxl.chart.data_source.NumVal at-
Float (class in openpyxl.descriptors.base), 123 tribute), 96
fLocksWithSheet (open- formatCode (openpyxl.styles.numbers.NumberFormat at-
pyxl.drawing.spreadsheet_drawing.AnchorClientData tribute), 183
attribute), 159 formatColumns (openpyxl.worksheet.protection.SheetProtection
floor (openpyxl.chart.bar_chart.BarChart3D attribute), 88 attribute), 207
floor (openpyxl.chart.chartspace.ChartContainer at- FormatObject (class in openpyxl.formatting.rule), 171
tribute), 90 formatRows (openpyxl.worksheet.protection.SheetProtection
fmla (openpyxl.drawing.shapes.GeomGuide attribute), attribute), 207
154 formatting (openpyxl.chart.chartspace.Protection at-
fmla (openpyxl.drawing.text.GeomGuide attribute), 164 tribute), 94
fmtId (openpyxl.chart.chartspace.PivotSource attribute), formula (openpyxl.formatting.rule.Rule attribute), 172
92 formula1 (openpyxl.worksheet.datavalidation.DataValidation
folHlink (openpyxl.drawing.colors.ColorMapping at- attribute), 194
tribute), 129 formula2 (openpyxl.worksheet.datavalidation.DataValidation
Font (class in openpyxl.drawing.text), 163 attribute), 194
Font (class in openpyxl.styles.fonts), 181 FORMULA_TAG (open-
font (openpyxl.cell.read_only.ReadOnlyCell attribute), 79 pyxl.reader.worksheet.WorkSheetParser at-
font (openpyxl.styles.differential.DifferentialStyle at- tribute), 175
tribute), 179 FormulaRule() (in module openpyxl.formatting.rule), 171
font (openpyxl.styles.named_styles.NamedStyle at- forward (openpyxl.chart.trendline.Trendline attribute),
tribute), 183 112
font (openpyxl.styles.Style attribute), 176 fov (openpyxl.drawing.shapes.Camera attribute), 153

248 Index
openpyxl Documentation, Release 2.4.0

fPrintsWithSheet (open- gapWidth (openpyxl.chart.updown_bars.UpDownBars at-


pyxl.drawing.spreadsheet_drawing.AnchorClientData tribute), 113
attribute), 159 gd (openpyxl.drawing.shapes.GeomGuideList attribute),
fPublished (openpyxl.drawing.graphic.Connector at- 155
tribute), 144 gd (openpyxl.drawing.text.GeomGuideList attribute), 164
fPublished (openpyxl.drawing.graphic.GraphicFrame at- gdLst (openpyxl.drawing.shapes.CustomGeometry2D at-
tribute), 145 tribute), 154
fPublished (openpyxl.drawing.graphic.PictureFrame at- GeomGuide (class in openpyxl.drawing.shapes), 154
tribute), 149 GeomGuide (class in openpyxl.drawing.text), 164
freeze_panes (openpyxl.worksheet.worksheet.Worksheet GeomGuideList (class in openpyxl.drawing.shapes), 154
attribute), 212 GeomGuideList (class in openpyxl.drawing.text), 164
from_excel() (in module openpyxl.utils.datetime), 186 GeomRect (class in openpyxl.drawing.shapes), 155
from_tree() (openpyxl.descriptors.nested.EmptyTag get() (openpyxl.worksheet.header_footer.HeaderFooterItem
method), 126 method), 202
from_tree() (openpyxl.descriptors.nested.Nested get_active_sheet() (open-
method), 126 pyxl.workbook.workbook.Workbook method),
from_tree() (openpyxl.descriptors.nested.NestedBool 192
method), 126 get_cell_collection() (open-
from_tree() (openpyxl.descriptors.nested.NestedText pyxl.worksheet.worksheet.Worksheet method),
method), 126 212
from_tree() (openpyxl.descriptors.sequence.NestedSequenceget_column_interval() (in module openpyxl.utils), 185
method), 127 get_column_letter() (in module openpyxl.utils), 185
from_tree() (openpyxl.descriptors.sequence.ValueSequence get_comments_file() (in module open-
method), 127 pyxl.comments.reader), 122
from_tree() (openpyxl.descriptors.serialisable.Serialisable get_dependents() (in module open-
class method), 127 pyxl.packaging.relationship), 174
from_tree() (openpyxl.styles.fills.Fill class method), 180 get_emu_dimensions() (open-
from_tree() (openpyxl.worksheet.page.PrintPageSetup pyxl.drawing.drawing.Drawing method),
class method), 204 132
fromWordArt (openpyxl.drawing.text.RichTextProperties get_index() (openpyxl.workbook.workbook.Workbook
attribute), 168 method), 192
fullCalcOnLoad (open- get_named_range() (open-
pyxl.workbook.properties.CalcProperties pyxl.workbook.workbook.Workbook method),
attribute), 190 192
fullPrecision (openpyxl.workbook.properties.CalcPropertiesget_named_range() (open-
attribute), 190 pyxl.worksheet.worksheet.Worksheet method),
212
G get_named_ranges() (open-
g (openpyxl.drawing.colors.RGBPercent attribute), 130 pyxl.workbook.workbook.Workbook method),
gamma (openpyxl.drawing.colors.SystemColor attribute), 192
131 get_rows_to_write() (in module open-
gapDepth (openpyxl.chart.area_chart.AreaChart3D at- pyxl.writer.etree_worksheet), 214
tribute), 82 get_sheet_by_name() (open-
gapDepth (openpyxl.chart.bar_chart.BarChart3D at- pyxl.workbook.workbook.Workbook method),
tribute), 88 192
gapDepth (openpyxl.chart.line_chart.LineChart3D get_sheet_names() (open-
attribute), 101 pyxl.workbook.workbook.Workbook method),
gapWidth (openpyxl.chart.bar_chart.BarChart attribute), 192
88 get_squared_range() (open-
gapWidth (openpyxl.chart.bar_chart.BarChart3D at- pyxl.worksheet.read_only.ReadOnlyWorksheet
tribute), 89 method), 208
gapWidth (openpyxl.chart.pie_chart.ProjectedPieChart get_squared_range() (open-
attribute), 104 pyxl.worksheet.worksheet.Worksheet method),
212

Index 249
openpyxl Documentation, Release 2.4.0

getFooter() (openpyxl.worksheet.header_footer.HeaderFooter tribute), 81


method), 201 grouping (openpyxl.chart.area_chart.AreaChart3D
getHeader() (openpyxl.worksheet.header_footer.HeaderFooter attribute), 82
method), 201 grouping (openpyxl.chart.bar_chart.BarChart attribute),
glow (openpyxl.drawing.effect.EffectList attribute), 133 88
GlowEffect (class in openpyxl.drawing.effect), 134 grouping (openpyxl.chart.bar_chart.BarChart3D at-
GMT (class in openpyxl.utils.datetime), 185 tribute), 89
gradFill (openpyxl.chart.shapes.GraphicalProperties at- grouping (openpyxl.chart.line_chart.LineChart attribute),
tribute), 109 101
gradFill (openpyxl.drawing.line.LineProperties attribute), grouping (openpyxl.chart.line_chart.LineChart3D at-
151 tribute), 101
gradFill (openpyxl.drawing.text.CharacterProperties at- GroupLocking (class in openpyxl.drawing.graphic), 145
tribute), 162 GroupShape (class in openpyxl.drawing.graphic), 146
GradientFill (class in openpyxl.styles.fills), 180 GroupShapeProperties (class in open-
GradientFillProperties (class in openpyxl.drawing.fill), pyxl.drawing.graphic), 146
141 GroupTransform2D (class in openpyxl.drawing.graphic),
GradientStop (class in openpyxl.drawing.fill), 142 146
GradientStopList (class in openpyxl.drawing.fill), 142 grow (openpyxl.drawing.effect.BlurEffect attribute), 133
graphic (openpyxl.drawing.graphic.GraphicFrame grpFill (openpyxl.drawing.text.CharacterProperties at-
attribute), 145 tribute), 162
GraphicalProperties (class in openpyxl.chart.shapes), 109 grpSp (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor
GraphicData (class in openpyxl.drawing.graphic), 144 attribute), 159
graphicData (openpyxl.drawing.graphic.GraphicObject grpSp (openpyxl.drawing.spreadsheet_drawing.OneCellAnchor
attribute), 145 attribute), 160
GraphicFrame (class in openpyxl.drawing.graphic), 145 grpSp (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor
graphicFrame (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor attribute), 160
attribute), 159 grpSpLocks (openpyxl.drawing.graphic.NonVisualGroupDrawingShapePro
graphicFrame (openpyxl.drawing.spreadsheet_drawing.OneCellAnchor attribute), 148
attribute), 160 grpSpPr (openpyxl.drawing.graphic.GroupShape at-
graphicFrame (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor tribute), 146
attribute), 160 gs (openpyxl.drawing.fill.GradientStopList attribute), 142
GraphicFrameLocking (class in open- gsLst (openpyxl.drawing.fill.GradientFillProperties at-
pyxl.drawing.graphic), 145 tribute), 142
graphicFrameLocks (open- gte (openpyxl.formatting.rule.FormatObject attribute),
pyxl.drawing.graphic.NonVisualGraphicFrameProperties 171
attribute), 148 guess_types (openpyxl.cell.cell.Cell attribute), 78
GraphicObject (class in openpyxl.drawing.graphic), 145 guess_types (openpyxl.cell.interface.AbstractCell at-
gray (openpyxl.drawing.colors.SystemColor attribute), tribute), 79
131 Guid (class in openpyxl.descriptors.excel), 125
GrayscaleEffect (class in openpyxl.drawing.effect), 135 guid (openpyxl.chartsheet.custom.CustomChartsheetView
grayscl (openpyxl.drawing.fill.Blip attribute), 140 attribute), 117
green (openpyxl.drawing.colors.SystemColor attribute), guid (openpyxl.comments.properties.Comment attribute),
131 121
greenMod (openpyxl.drawing.colors.SystemColor
attribute), 131 H
greenOff (openpyxl.drawing.colors.SystemColor at- h (openpyxl.chart.layout.ManualLayout attribute), 99
tribute), 131 h (openpyxl.drawing.shapes.Bevel attribute), 153
gridLines (openpyxl.worksheet.page.PrintOptions at- h (openpyxl.drawing.shapes.Path2D attribute), 155
tribute), 203 hangingPunct (openpyxl.drawing.text.ParagraphProperties
gridLinesSet (openpyxl.worksheet.page.PrintOptions at- attribute), 167
tribute), 203 has() (openpyxl.worksheet.header_footer.HeaderFooterItem
group() (openpyxl.worksheet.dimensions.DimensionHolder method), 202
method), 196 has_style (openpyxl.styles.styleable.StyleableObject at-
grouping (openpyxl.chart.area_chart.AreaChart at- tribute), 184

250 Index
openpyxl Documentation, Release 2.4.0

hasFooter() (openpyxl.worksheet.header_footer.HeaderFooterhiLowLines (openpyxl.chart.line_chart.LineChart3D at-


method), 201 tribute), 101
hash_password() (in module open- hiLowLines (openpyxl.chart.stock_chart.StockChart at-
pyxl.worksheet.protection), 208 tribute), 110
hash_password() (open- history (openpyxl.drawing.text.Hyperlink attribute), 164
pyxl.chartsheet.protection.ChartsheetProtection hlink (openpyxl.drawing.colors.ColorMapping attribute),
method), 118 129
HashableObject (class in openpyxl.styles.hashable), 182 hlinkClick (openpyxl.drawing.graphic.NonVisualDrawingProps
hasHeader() (openpyxl.worksheet.header_footer.HeaderFooter attribute), 147
method), 201 hlinkClick (openpyxl.drawing.text.CharacterProperties
hashValue (openpyxl.chartsheet.protection.ChartsheetProtection attribute), 162
attribute), 118 hlinkHover (openpyxl.drawing.graphic.NonVisualDrawingProps
hashValue (openpyxl.worksheet.protection.SheetProtection attribute), 147
attribute), 207 hlinkMouseOver (open-
headEnd (openpyxl.drawing.line.LineProperties at- pyxl.drawing.text.CharacterProperties at-
tribute), 151 tribute), 162
header (openpyxl.worksheet.page.PageMargins attribute), hMode (openpyxl.chart.layout.ManualLayout attribute),
202 99
HeaderFooter (class in open- holeSize (openpyxl.chart.pie_chart.DoughnutChart at-
pyxl.worksheet.header_footer), 200 tribute), 103
headerFooter (openpyxl.chart.chartspace.PrintSettings at- horizontal (openpyxl.styles.alignment.Alignment at-
tribute), 94 tribute), 176
headerFooter (openpyxl.chartsheet.chartsheet.Chartsheet horizontal (openpyxl.styles.borders.Border attribute), 177
attribute), 116 horizontalCentered (open-
headerFooter (openpyxl.chartsheet.custom.CustomChartsheetView pyxl.worksheet.page.PrintOptions attribute),
attribute), 117 203
HeaderFooterItem (class in open- horizontalCentered() (open-
pyxl.worksheet.header_footer), 201 pyxl.worksheet.page.PrintPageSetup method),
headings (openpyxl.worksheet.page.PrintOptions at- 204
tribute), 203 horizontalDpi (openpyxl.worksheet.page.PrintPageSetup
height (openpyxl.drawing.drawing.Drawing attribute), attribute), 204
132 horzOverflow (openpyxl.drawing.text.RichTextProperties
HexBinary (class in openpyxl.descriptors.excel), 125 attribute), 168
hidden (openpyxl.drawing.graphic.NonVisualDrawingPropshour (openpyxl.worksheet.filters.DateGroupItem at-
attribute), 147 tribute), 198
hidden (openpyxl.styles.named_styles.NamedCellStyle hsl (openpyxl.drawing.fill.Blip attribute), 140
attribute), 182 hslClr (openpyxl.drawing.colors.ColorChoice attribute),
hidden (openpyxl.styles.named_styles.NamedStyle at- 128
tribute), 183 hslClr (openpyxl.drawing.effect.GlowEffect attribute),
hidden (openpyxl.styles.protection.Protection attribute), 134
184 hslClr (openpyxl.drawing.effect.InnerShadowEffect at-
hidden (openpyxl.worksheet.dimensions.Dimension at- tribute), 135
tribute), 195 hslClr (openpyxl.drawing.effect.OuterShadowEffect at-
hiddenButton (openpyxl.worksheet.filters.FilterColumn tribute), 136
attribute), 199 hslClr (openpyxl.drawing.effect.PresetShadowEffect at-
hidePivotFieldList (open- tribute), 137
pyxl.workbook.properties.WorkbookProperties HSLColor (class in openpyxl.drawing.colors), 130
attribute), 191 HSLEffect (class in openpyxl.drawing.effect), 135
highlight (openpyxl.drawing.text.CharacterProperties at- ht (openpyxl.worksheet.dimensions.RowDimension at-
tribute), 162 tribute), 196
highlightClick (openpyxl.drawing.text.Hyperlink at- hue (openpyxl.drawing.colors.HSLColor attribute), 130
tribute), 164 hue (openpyxl.drawing.colors.SystemColor attribute),
hiLowLines (openpyxl.chart.line_chart.LineChart at- 131
tribute), 101 hue (openpyxl.drawing.effect.HSLEffect attribute), 135

Index 251
openpyxl Documentation, Release 2.4.0

hue (openpyxl.drawing.effect.TintEffect attribute), 139 idx (openpyxl.chart.data_source.NumVal attribute), 96


hueMod (openpyxl.drawing.colors.SystemColor at- idx (openpyxl.chart.data_source.StrVal attribute), 96
tribute), 131 idx (openpyxl.chart.label.DataLabel attribute), 98
hueOff (openpyxl.drawing.colors.SystemColor attribute), idx (openpyxl.chart.legend.LegendEntry attribute), 100
131 idx (openpyxl.chart.marker.DataPoint attribute), 102
Hyperlink (class in openpyxl.drawing.text), 164 idx (openpyxl.chart.series.Series attribute), 107
Hyperlink (class in openpyxl.worksheet.hyperlink), 202 idx (openpyxl.chart.series.XYSeries attribute), 108
hyperlink (openpyxl.cell.cell.Cell attribute), 78 idx (openpyxl.chart.surface_chart.BandFormat attribute),
110
I idx (openpyxl.drawing.graphic.Connection attribute), 144
i (openpyxl.cell.text.InlineFont attribute), 80 idx (openpyxl.drawing.shapes.FontReference attribute),
i (openpyxl.drawing.text.CharacterProperties attribute), 154
162 idx (openpyxl.drawing.shapes.StyleMatrixReference at-
i (openpyxl.styles.fonts.Font attribute), 181 tribute), 158
IconFilter (class in openpyxl.worksheet.filters), 199 idx_base (openpyxl.descriptors.sequence.Sequence at-
iconFilter (openpyxl.worksheet.filters.FilterColumn at- tribute), 127
tribute), 199 idx_base (openpyxl.descriptors.serialisable.Serialisable
iconId (openpyxl.worksheet.filters.IconFilter attribute), attribute), 127
199 iLevel (openpyxl.styles.named_styles.NamedCellStyle
iconId (openpyxl.worksheet.filters.SortCondition at- attribute), 182
tribute), 200 IllegalCharacterError, 186
IconSet (class in openpyxl.formatting.rule), 171 Image (class in openpyxl.drawing.image), 150
iconSet (openpyxl.formatting.rule.IconSet attribute), 171 imeMode (openpyxl.worksheet.datavalidation.DataValidation
iconSet (openpyxl.formatting.rule.Rule attribute), 172 attribute), 194
iconSet (openpyxl.worksheet.filters.IconFilter attribute), inch_to_dxa() (in module openpyxl.utils.units), 187
199 inch_to_EMU() (in module openpyxl.utils.units), 187
iconSet (openpyxl.worksheet.filters.SortCondition indent (openpyxl.drawing.text.ParagraphProperties at-
attribute), 200 tribute), 167
IconSetRule() (in module openpyxl.formatting.rule), 171 indent (openpyxl.styles.alignment.Alignment attribute),
id (openpyxl.chart.chartspace.ExternalData attribute), 92 177
id (openpyxl.chartsheet.publish.WebPublishItem at- index (openpyxl.styles.colors.Color attribute), 178
tribute), 118 index (openpyxl.styles.colors.ColorList attribute), 179
id (openpyxl.chartsheet.relation.DrawingHF attribute), index (openpyxl.worksheet.dimensions.ColumnDimension
119 attribute), 195
id (openpyxl.chartsheet.relation.SheetBackgroundPicture index (openpyxl.worksheet.dimensions.Dimension
attribute), 120 attribute), 195
id (openpyxl.drawing.graphic.ChartRelation attribute), index() (openpyxl.utils.indexed_list.IndexedList method),
144 187
id (openpyxl.drawing.graphic.Connection attribute), 144 indexed (openpyxl.styles.colors.Color attribute), 178
id (openpyxl.drawing.graphic.NonVisualDrawingProps IndexedColorList (class in openpyxl.styles.colors), 179
attribute), 147 indexedColors (openpyxl.styles.colors.ColorList at-
id (openpyxl.drawing.text.TextField attribute), 169 tribute), 179
Id (openpyxl.packaging.relationship.Relationship at- IndexedList (class in openpyxl.utils.indexed_list), 186
tribute), 174 INLINE_STRING (open-
Id (openpyxl.workbook.names.external.ExternalBook at- pyxl.reader.worksheet.WorkSheetParser at-
tribute), 188 tribute), 175
id (openpyxl.worksheet.drawing.Drawing attribute), 196 InlineFont (class in openpyxl.cell.text), 79
id (openpyxl.worksheet.hyperlink.Hyperlink attribute), InnerShadowEffect (class in openpyxl.drawing.effect),
202 135
id (openpyxl.worksheet.page.PrintPageSetup attribute), innerShdw (openpyxl.drawing.effect.EffectList attribute),
204 134
id (openpyxl.worksheet.pagebreak.Break attribute), 205 insertColumns (openpyxl.worksheet.protection.SheetProtection
id (openpyxl.worksheet.related.Related attribute), 209 attribute), 207
idx (openpyxl.chart.chartspace.PivotFormat attribute), 92 insertHyperlinks (open-

252 Index
openpyxl Documentation, Release 2.4.0

pyxl.worksheet.protection.SheetProtection K
attribute), 207 kern (openpyxl.drawing.text.CharacterProperties at-
insertRows (openpyxl.worksheet.protection.SheetProtection tribute), 162
attribute), 207 key (openpyxl.styles.hashable.HashableObject attribute),
InsufficientCoordinatesException, 186 182
Integer (class in openpyxl.descriptors.base), 124 key (openpyxl.styles.styleable.NumberFormatDescriptor
intercept (openpyxl.chart.trendline.Trendline attribute), attribute), 184
113 kumimoji (openpyxl.drawing.text.CharacterProperties at-
internal_value (openpyxl.cell.cell.Cell attribute), 78 tribute), 162
internal_value (openpyxl.cell.interface.AbstractCell at- kx (openpyxl.drawing.effect.OuterShadowEffect at-
tribute), 79 tribute), 136
internal_value (openpyxl.cell.read_only.ReadOnlyCell kx (openpyxl.drawing.effect.ReflectionEffect attribute),
attribute), 79 139
inv (openpyxl.drawing.colors.SystemColor attribute), 131 ky (openpyxl.drawing.effect.OuterShadowEffect at-
InvalidFileException, 186 tribute), 136
invalidUrl (openpyxl.drawing.text.Hyperlink attribute), ky (openpyxl.drawing.effect.ReflectionEffect attribute),
164 139
invertIfNegative (openpyxl.chart.marker.DataPoint
attribute), 102 L
invertIfNegative (openpyxl.chart.series.Series attribute), l (openpyxl.drawing.fill.RelativeRect attribute), 143
107 l (openpyxl.drawing.shapes.GeomRect attribute), 155
invertIfNegative (openpyxl.chart.series.XYSeries at- lang (openpyxl.chart.chartspace.ChartSpace attribute), 91
tribute), 108 lang (openpyxl.drawing.text.CharacterProperties at-
invGamma (openpyxl.drawing.colors.SystemColor tribute), 162
attribute), 131 lastClr (openpyxl.drawing.colors.SystemColor attribute),
is_builtin() (in module openpyxl.styles.numbers), 184 131
is_date (openpyxl.cell.cell.Cell attribute), 78 lastEdited (openpyxl.workbook.properties.FileVersion at-
is_date (openpyxl.cell.interface.AbstractCell attribute), tribute), 190
79 lat (openpyxl.drawing.shapes.SphereCoords attribute),
is_date (openpyxl.cell.read_only.ReadOnlyCell at- 158
tribute), 79 latin (openpyxl.drawing.text.CharacterProperties at-
is_date_format() (in module openpyxl.styles.numbers), tribute), 162
184 latinLnBrk (openpyxl.drawing.text.ParagraphProperties
isgenerator() (in module openpyxl.worksheet), 193 attribute), 167
isgenerator() (in module openpyxl.worksheet.worksheet), Layout (class in openpyxl.chart.layout), 99
213 layout (openpyxl.chart.axis.DisplayUnitsLabel attribute),
isgenerator() (in module openpyxl.writer.write_only), 216 84
iter_rows() (openpyxl.worksheet.worksheet.Worksheet layout (openpyxl.chart.chartspace.PlotArea attribute), 93
method), 213 layout (openpyxl.chart.legend.Legend attribute), 100
iterate (openpyxl.workbook.properties.CalcProperties at- layout (openpyxl.chart.title.Title attribute), 112
tribute), 190 layout (openpyxl.chart.trendline.TrendlineLabel at-
iterateCount (openpyxl.workbook.properties.CalcProperties tribute), 113
attribute), 190 layoutTarget (openpyxl.chart.layout.ManualLayout at-
iterateDelta (openpyxl.workbook.properties.CalcProperties tribute), 99
attribute), 190 lblAlgn (openpyxl.chart.axis.TextAxis attribute), 87
iterparse() (in module openpyxl.xml.functions), 216 lblOffset (openpyxl.chart.axis.DateAxis attribute), 83
lblOffset (openpyxl.chart.axis.TextAxis attribute), 87
J left (openpyxl.styles.borders.Border attribute), 178
justifyLastLine (openpyxl.styles.alignment.Alignment at- left (openpyxl.styles.fills.GradientFill attribute), 180
tribute), 177 LEFT (openpyxl.worksheet.header_footer.HeaderFooterItem
justLastX (openpyxl.comments.properties.Properties at- attribute), 202
tribute), 122 left (openpyxl.worksheet.page.PageMargins attribute),
203

Index 253
openpyxl Documentation, Release 2.4.0

left_footer (openpyxl.worksheet.header_footer.HeaderFooterlnRef (openpyxl.drawing.shapes.ShapeStyle attribute),


attribute), 201 158
left_header (openpyxl.worksheet.header_footer.HeaderFooterlnSpc (openpyxl.drawing.text.ParagraphProperties
attribute), 201 attribute), 167
Legend (class in openpyxl.chart.legend), 100 lnSpcReduction (openpyxl.drawing.text.TextNormalAutofit
legend (openpyxl.chart.chartspace.ChartContainer attribute), 170
attribute), 90 load_workbook() (in module openpyxl.reader.excel), 174
LegendEntry (class in openpyxl.chart.legend), 100 localname() (in module openpyxl.xml.functions), 216
legendEntry (openpyxl.chart.legend.Legend attribute), localSheetId (openpyxl.workbook.names.named_range.NamedValue
100 attribute), 189
legendPos (openpyxl.chart.legend.Legend attribute), 100 location (openpyxl.worksheet.hyperlink.Hyperlink
len (openpyxl.drawing.line.LineEndProperties attribute), attribute), 202
150 locked (openpyxl.comments.properties.Properties at-
Length (class in openpyxl.descriptors.base), 124 tribute), 122
lfe (openpyxl.chartsheet.relation.DrawingHF attribute), locked (openpyxl.styles.protection.Protection attribute),
119 184
lff (openpyxl.chartsheet.relation.DrawingHF attribute), lockText (openpyxl.comments.properties.Properties at-
119 tribute), 122
lfo (openpyxl.chartsheet.relation.DrawingHF attribute), logBase (openpyxl.chart.axis.Scaling attribute), 85
119 lon (openpyxl.drawing.shapes.SphereCoords attribute),
lhe (openpyxl.chartsheet.relation.DrawingHF attribute), 158
119 lowestEdited (openpyxl.workbook.properties.FileVersion
lhf (openpyxl.chartsheet.relation.DrawingHF attribute), attribute), 190
119 lstStyle (openpyxl.chart.text.RichText attribute), 111
lho (openpyxl.chartsheet.relation.DrawingHF attribute), lum (openpyxl.drawing.colors.HSLColor attribute), 130
119 lum (openpyxl.drawing.colors.SystemColor attribute),
LightRig (class in openpyxl.drawing.shapes), 155 131
lightRig (openpyxl.drawing.shapes.Scene3D attribute), lum (openpyxl.drawing.effect.HSLEffect attribute), 135
157 lum (openpyxl.drawing.fill.Blip attribute), 140
lim (openpyxl.drawing.line.LineJoinMiterProperties at- LuminanceEffect (class in openpyxl.drawing.effect), 136
tribute), 151 lumMod (openpyxl.drawing.colors.SystemColor at-
lin (openpyxl.drawing.fill.GradientFillProperties at- tribute), 131
tribute), 142 lumOff (openpyxl.drawing.colors.SystemColor attribute),
line3DChart (openpyxl.chart.chartspace.PlotArea at- 131
tribute), 93 lvl (openpyxl.drawing.text.ParagraphProperties attribute),
LinearShadeProperties (class in openpyxl.drawing.fill), 167
142 lvl1pPr (openpyxl.drawing.text.ListStyle attribute), 165
LineBreak (class in openpyxl.drawing.text), 164 lvl2pPr (openpyxl.drawing.text.ListStyle attribute), 165
LineChart (class in openpyxl.chart.line_chart), 100 lvl3pPr (openpyxl.drawing.text.ListStyle attribute), 165
lineChart (openpyxl.chart.chartspace.PlotArea attribute), lvl4pPr (openpyxl.drawing.text.ListStyle attribute), 165
93 lvl5pPr (openpyxl.drawing.text.ListStyle attribute), 165
LineChart3D (class in openpyxl.chart.line_chart), 101 lvl6pPr (openpyxl.drawing.text.ListStyle attribute), 165
LineEndProperties (class in openpyxl.drawing.line), 150 lvl7pPr (openpyxl.drawing.text.ListStyle attribute), 165
LineJoinMiterProperties (class in openpyxl.drawing.line), lvl8pPr (openpyxl.drawing.text.ListStyle attribute), 165
151 lvl9pPr (openpyxl.drawing.text.ListStyle attribute), 165
LineProperties (class in openpyxl.drawing.line), 151 lxml_available() (in module openpyxl.xml), 216
link (openpyxl.drawing.fill.Blip attribute), 140 lxml_env_set() (in module openpyxl.xml), 216
lIns (openpyxl.drawing.text.RichTextProperties at-
tribute), 168 M
ListStyle (class in openpyxl.drawing.text), 164 macro (openpyxl.drawing.graphic.Connector attribute),
ln (openpyxl.chart.shapes.GraphicalProperties attribute), 144
109 macro (openpyxl.drawing.graphic.GraphicFrame at-
ln (openpyxl.drawing.text.CharacterProperties attribute), tribute), 145
162

254 Index
openpyxl Documentation, Release 2.4.0

macro (openpyxl.drawing.graphic.PictureFrame at- tribute), 97


tribute), 149 max (openpyxl.chart.descriptors.NestedOverlap at-
majorGridlines (openpyxl.chart.axis.DateAxis attribute), tribute), 97
83 max (openpyxl.descriptors.excel.TextPoint attribute), 125
majorGridlines (openpyxl.chart.axis.NumericAxis max (openpyxl.worksheet.dimensions.ColumnDimension
attribute), 85 attribute), 195
majorGridlines (openpyxl.chart.axis.SeriesAxis at- max (openpyxl.worksheet.pagebreak.Break attribute),
tribute), 86 205
majorGridlines (openpyxl.chart.axis.TextAxis attribute), max_col (openpyxl.chart.reference.Reference attribute),
87 106
majorTickMark (openpyxl.chart.axis.DateAxis attribute), max_column (openpyxl.worksheet.read_only.ReadOnlyWorksheet
83 attribute), 208
majorTickMark (openpyxl.chart.axis.NumericAxis max_column (openpyxl.worksheet.worksheet.Worksheet
attribute), 85 attribute), 213
majorTickMark (openpyxl.chart.axis.SeriesAxis at- max_row (openpyxl.chart.reference.Reference attribute),
tribute), 86 106
majorTickMark (openpyxl.chart.axis.TextAxis attribute), max_row (openpyxl.worksheet.read_only.ReadOnlyWorksheet
87 attribute), 208
majorTimeUnit (openpyxl.chart.axis.DateAxis attribute), max_row (openpyxl.worksheet.worksheet.Worksheet at-
83 tribute), 213
majorUnit (openpyxl.chart.axis.DateAxis attribute), 83 maxLength (openpyxl.formatting.rule.DataBar attribute),
majorUnit (openpyxl.chart.axis.NumericAxis attribute), 171
85 maxVal (openpyxl.worksheet.filters.DynamicFilter
man (openpyxl.worksheet.pagebreak.Break attribute), attribute), 198
205 maxValIso (openpyxl.worksheet.filters.DynamicFilter at-
Manifest (class in openpyxl.packaging.manifest), 173 tribute), 198
manualBreakCount (open- merge_cells() (openpyxl.worksheet.worksheet.Worksheet
pyxl.worksheet.pagebreak.PageBreak at- method), 213
tribute), 205 merge_cells() (openpyxl.writer.write_only.WriteOnlyWorksheet
ManualLayout (class in openpyxl.chart.layout), 99 method), 215
manualLayout (openpyxl.chart.layout.Layout attribute), MERGE_TAG (openpyxl.reader.worksheet.WorkSheetParser
99 attribute), 175
MARGIN_BOTTOM (openpyxl.drawing.shape.Shape at- merged_cell_ranges (open-
tribute), 152 pyxl.worksheet.worksheet.Worksheet at-
MARGIN_LEFT (openpyxl.drawing.shape.Shape at- tribute), 213
tribute), 152 merged_cells (openpyxl.worksheet.worksheet.Worksheet
Marker (class in openpyxl.chart.marker), 102 attribute), 213
marker (openpyxl.chart.chartspace.PivotFormat at- MetaSerialisable (class in openpyxl.descriptors), 123
tribute), 92 MetaStrict (class in openpyxl.descriptors), 123
marker (openpyxl.chart.line_chart.LineChart attribute), Min (class in openpyxl.descriptors.base), 124
101 min (openpyxl.chart.axis.Scaling attribute), 85
marker (openpyxl.chart.line_chart.LineChart3D at- min (openpyxl.chart.descriptors.NestedGapAmount at-
tribute), 101 tribute), 97
marker (openpyxl.chart.marker.DataPoint attribute), 102 min (openpyxl.chart.descriptors.NestedOverlap at-
marker (openpyxl.chart.series.Series attribute), 107 tribute), 97
marker (openpyxl.chart.series.XYSeries attribute), 108 min (openpyxl.descriptors.excel.TextPoint attribute), 125
marL (openpyxl.drawing.text.ParagraphProperties at- min (openpyxl.worksheet.dimensions.ColumnDimension
tribute), 167 attribute), 195
marR (openpyxl.drawing.text.ParagraphProperties min (openpyxl.worksheet.pagebreak.Break attribute), 205
attribute), 167 min_col (openpyxl.chart.reference.Reference attribute),
MatchPattern (class in openpyxl.descriptors.base), 124 106
Max (class in openpyxl.descriptors.base), 124 min_column (openpyxl.worksheet.read_only.ReadOnlyWorksheet
max (openpyxl.chart.axis.Scaling attribute), 85 attribute), 208
max (openpyxl.chart.descriptors.NestedGapAmount at- min_column (openpyxl.worksheet.worksheet.Worksheet

Index 255
openpyxl Documentation, Release 2.4.0

attribute), 213 name (openpyxl.drawing.text.EmbeddedWAVAudioFile


min_row (openpyxl.chart.reference.Reference attribute), attribute), 163
106 name (openpyxl.drawing.text.GeomGuide attribute), 164
min_row (openpyxl.worksheet.read_only.ReadOnlyWorksheet name (openpyxl.styles.fonts.Font attribute), 181
attribute), 208 name (openpyxl.styles.named_styles.NamedCellStyle at-
min_row (openpyxl.worksheet.worksheet.Worksheet at- tribute), 182
tribute), 213 name (openpyxl.workbook.names.external.ExternalRange
minLength (openpyxl.formatting.rule.DataBar attribute), attribute), 188
171 name (openpyxl.workbook.names.named_range.NamedRange
MinMax (class in openpyxl.descriptors.base), 124 attribute), 189
minorGridlines (openpyxl.chart.axis.DateAxis attribute), name (openpyxl.workbook.names.named_range.NamedValue
83 attribute), 189
minorGridlines (openpyxl.chart.axis.NumericAxis NamedCellStyle (class in openpyxl.styles.named_styles),
attribute), 85 182
minorGridlines (openpyxl.chart.axis.SeriesAxis at- NamedCellStyleList (class in open-
tribute), 86 pyxl.styles.named_styles), 182
minorGridlines (openpyxl.chart.axis.TextAxis attribute), NamedRange (class in open-
87 pyxl.workbook.names.named_range), 188
minorTickMark (openpyxl.chart.axis.DateAxis attribute), NamedRangeContainingValue (in module open-
83 pyxl.workbook.names.named_range), 189
minorTickMark (openpyxl.chart.axis.NumericAxis at- NamedRangeException, 186
tribute), 85 NamedStyle (class in openpyxl.styles.named_styles), 183
minorTickMark (openpyxl.chart.axis.SeriesAxis at- NamedValue (class in open-
tribute), 86 pyxl.workbook.names.named_range), 189
minorTickMark (openpyxl.chart.axis.TextAxis attribute), names (openpyxl.styles.named_styles.NamedCellStyleList
87 attribute), 182
minorTimeUnit (openpyxl.chart.axis.DateAxis attribute), namespace (openpyxl.descriptors.excel.Relation at-
83 tribute), 125
minorUnit (openpyxl.chart.axis.DateAxis attribute), 83 namespace (openpyxl.descriptors.serialisable.Serialisable
minorUnit (openpyxl.chart.axis.NumericAxis attribute), attribute), 127
85 namespace (openpyxl.drawing.colors.ColorChoice
minus (openpyxl.chart.error_bar.ErrorBars attribute), 97 attribute), 128
minute (openpyxl.worksheet.filters.DateGroupItem at- namespace (openpyxl.drawing.fill.Blip attribute), 140
tribute), 198 namespace (openpyxl.drawing.fill.PatternFillProperties
miter (openpyxl.drawing.line.LineProperties attribute), attribute), 142
151 namespace (openpyxl.drawing.fill.RelativeRect attribute),
month (openpyxl.worksheet.filters.DateGroupItem 143
attribute), 198 namespace (openpyxl.drawing.fill.StretchInfoProperties
moveWithCells (openpyxl.comments.properties.ObjectAnchor attribute), 143
attribute), 121 namespace (openpyxl.drawing.graphic.ChartRelation at-
MRUColorList (class in openpyxl.styles.colors), 179 tribute), 144
mruColors (openpyxl.styles.colors.ColorList attribute), namespace (openpyxl.drawing.graphic.GraphicData at-
179 tribute), 144
namespace (openpyxl.drawing.graphic.GraphicObject at-
N tribute), 145
name (openpyxl.chart.chartspace.PivotSource attribute), namespace (openpyxl.drawing.graphic.PictureLocking
93 attribute), 149
name (openpyxl.chart.trendline.Trendline attribute), 113 namespace (openpyxl.drawing.line.DashStop attribute),
name (openpyxl.drawing.effect.EffectContainer at- 150
tribute), 133 namespace (openpyxl.drawing.line.LineEndProperties at-
name (openpyxl.drawing.graphic.NonVisualDrawingProps tribute), 150
attribute), 147 namespace (openpyxl.drawing.line.LineJoinMiterProperties
name (openpyxl.drawing.shapes.GeomGuide attribute), attribute), 151
154 namespace (openpyxl.drawing.line.LineProperties

256 Index
openpyxl Documentation, Release 2.4.0

attribute), 151 attribute), 145


namespace (openpyxl.drawing.shapes.PresetGeometry2D noChangeAspect (open-
attribute), 156 pyxl.drawing.graphic.GroupLocking attribute),
namespace (openpyxl.drawing.text.CharacterProperties 146
attribute), 162 noChangeAspect (open-
namespace (openpyxl.drawing.text.Font attribute), 163 pyxl.drawing.graphic.PictureLocking at-
namespace (openpyxl.drawing.text.ListStyle attribute), tribute), 149
165 noChangeShapeType (openpyxl.drawing.fill.Blip at-
namespace (openpyxl.drawing.text.Paragraph attribute), tribute), 141
165 noChangeShapeType (open-
namespace (openpyxl.drawing.text.ParagraphProperties pyxl.drawing.graphic.PictureLocking at-
attribute), 167 tribute), 149
namespace (openpyxl.drawing.text.RegularTextRun at- noCrop (openpyxl.drawing.graphic.PictureLocking at-
tribute), 167 tribute), 149
namespace (openpyxl.drawing.text.RichTextProperties noDrilldown (openpyxl.drawing.graphic.GraphicFrameLocking
attribute), 168 attribute), 145
namespaced() (in module open- noEditPoints (openpyxl.drawing.fill.Blip attribute), 141
pyxl.descriptors.namespace), 126 noEditPoints (openpyxl.drawing.graphic.PictureLocking
Nested (class in openpyxl.descriptors.nested), 126 attribute), 149
nested (openpyxl.descriptors.base.Typed attribute), 125 noEndCap (openpyxl.chart.error_bar.ErrorBars attribute),
nested (openpyxl.descriptors.nested.Nested attribute), 97
126 noFill (openpyxl.chart.shapes.GraphicalProperties
NestedBool (class in openpyxl.descriptors.nested), 126 attribute), 109
NestedFloat (class in openpyxl.descriptors.nested), 126 noFill (openpyxl.drawing.line.LineProperties attribute),
NestedGapAmount (class in openpyxl.chart.descriptors), 151
96 noFill (openpyxl.drawing.text.CharacterProperties
NestedInteger (class in openpyxl.descriptors.nested), 126 attribute), 162
NestedMinMax (class in openpyxl.descriptors.nested), noGrp (openpyxl.drawing.fill.Blip attribute), 141
126 noGrp (openpyxl.drawing.graphic.GraphicFrameLocking
NestedNoneSet (class in openpyxl.descriptors.nested), attribute), 145
126 noGrp (openpyxl.drawing.graphic.GroupLocking at-
NestedOverlap (class in openpyxl.chart.descriptors), 97 tribute), 146
NestedSequence (class in open- noGrp (openpyxl.drawing.graphic.PictureLocking at-
pyxl.descriptors.sequence), 127 tribute), 149
NestedSet (class in openpyxl.descriptors.nested), 126 noMove (openpyxl.drawing.fill.Blip attribute), 141
NestedString (class in openpyxl.descriptors.nested), 126 noMove (openpyxl.drawing.graphic.GraphicFrameLocking
NestedText (class in openpyxl.descriptors.nested), 126 attribute), 145
NestedValue (class in openpyxl.descriptors.nested), 126 noMove (openpyxl.drawing.graphic.GroupLocking at-
noAdjustHandles (openpyxl.drawing.fill.Blip attribute), tribute), 146
140 noMove (openpyxl.drawing.graphic.PictureLocking at-
noAdjustHandles (open- tribute), 149
pyxl.drawing.graphic.PictureLocking at- noMultiLvlLbl (openpyxl.chart.axis.TextAxis attribute),
tribute), 149 87
noAutofit (openpyxl.drawing.text.RichTextProperties at- NoneSet (class in openpyxl.descriptors.base), 124
tribute), 168 NonVisualConnectorProperties (class in open-
noChangeArrowheads (openpyxl.drawing.fill.Blip at- pyxl.drawing.graphic), 147
tribute), 141 NonVisualDrawingProps (class in open-
noChangeArrowheads (open- pyxl.drawing.graphic), 147
pyxl.drawing.graphic.PictureLocking at- NonVisualGraphicFrame (class in open-
tribute), 149 pyxl.drawing.graphic), 148
noChangeAspect (openpyxl.drawing.fill.Blip attribute), NonVisualGraphicFrameProperties (class in open-
141 pyxl.drawing.graphic), 148
noChangeAspect (open- NonVisualGroupDrawingShapeProps (class in open-
pyxl.drawing.graphic.GraphicFrameLocking pyxl.drawing.graphic), 148

Index 257
openpyxl Documentation, Release 2.4.0

NonVisualGroupShape (class in open- 95


pyxl.drawing.graphic), 148 NumericAxis (class in openpyxl.chart.axis), 84
NonVisualPictureProperties (class in open- NumFmt (class in openpyxl.chart.data_source), 95
pyxl.drawing.graphic), 148 numFmt (openpyxl.chart.axis.DateAxis attribute), 83
noProof (openpyxl.drawing.text.CharacterProperties at- numFmt (openpyxl.chart.axis.NumericAxis attribute), 85
tribute), 162 numFmt (openpyxl.chart.axis.SeriesAxis attribute), 86
noResize (openpyxl.drawing.fill.Blip attribute), 141 numFmt (openpyxl.chart.axis.TextAxis attribute), 87
noResize (openpyxl.drawing.graphic.GraphicFrameLockingnumFmt (openpyxl.chart.label.DataLabel attribute), 98
attribute), 145 numFmt (openpyxl.chart.label.DataLabelList attribute),
noResize (openpyxl.drawing.graphic.GroupLocking at- 98
tribute), 146 numFmt (openpyxl.chart.trendline.TrendlineLabel
noResize (openpyxl.drawing.graphic.PictureLocking at- attribute), 113
tribute), 149 numFmt (openpyxl.styles.differential.DifferentialStyle
norm (openpyxl.drawing.shapes.Backdrop attribute), 153 attribute), 179
normalizeH (openpyxl.drawing.text.CharacterProperties numFmt (openpyxl.styles.numbers.NumberFormatList
attribute), 162 attribute), 183
normAutofit (openpyxl.drawing.text.RichTextProperties numFmtId (openpyxl.styles.numbers.NumberFormat at-
attribute), 168 tribute), 183
noRot (openpyxl.drawing.fill.Blip attribute), 141 numLit (openpyxl.chart.data_source.AxDataSource at-
noRot (openpyxl.drawing.graphic.GroupLocking at- tribute), 95
tribute), 146 numLit (openpyxl.chart.data_source.NumDataSource at-
noRot (openpyxl.drawing.graphic.PictureLocking at- tribute), 95
tribute), 150 NumRef (class in openpyxl.chart.data_source), 95
noSelect (openpyxl.drawing.fill.Blip attribute), 141 numRef (openpyxl.chart.data_source.AxDataSource at-
noSelect (openpyxl.drawing.graphic.GraphicFrameLocking tribute), 95
attribute), 145 numRef (openpyxl.chart.data_source.NumDataSource at-
noSelect (openpyxl.drawing.graphic.GroupLocking at- tribute), 95
tribute), 146 NumVal (class in openpyxl.chart.data_source), 96
noSelect (openpyxl.drawing.graphic.PictureLocking at- nvCxnSpPr (openpyxl.drawing.graphic.Connector at-
tribute), 150 tribute), 144
noUngrp (openpyxl.drawing.graphic.GroupLocking at- nvGraphicFramePr (open-
tribute), 146 pyxl.drawing.graphic.GraphicFrame attribute),
number_format (openpyxl.cell.interface.AbstractCell at- 145
tribute), 79 nvGrpSpPr (openpyxl.drawing.graphic.GroupShape at-
number_format (openpyxl.cell.read_only.ReadOnlyCell tribute), 146
attribute), 79 nvPicPr (openpyxl.drawing.graphic.PictureFrame at-
number_format (openpyxl.styles.named_styles.NamedStyle tribute), 149
attribute), 183
number_format (openpyxl.styles.Style attribute), 176 O
NumberFormat (class in openpyxl.styles.numbers), 183 ObjectAnchor (class in openpyxl.comments.properties),
NumberFormatDescriptor (class in open- 121
pyxl.chart.descriptors), 97 objects (openpyxl.chartsheet.protection.ChartsheetProtection
NumberFormatDescriptor (class in open- attribute), 118
pyxl.styles.numbers), 183 objects (openpyxl.worksheet.protection.SheetProtection
NumberFormatDescriptor (class in open- attribute), 207
pyxl.styles.styleable), 184 off (openpyxl.drawing.graphic.GroupTransform2D at-
NumberFormatList (class in openpyxl.styles.numbers), tribute), 147
183 off (openpyxl.drawing.shapes.Transform2D attribute),
numCache (openpyxl.chart.data_source.NumRef at- 158
tribute), 96 offset() (openpyxl.cell.cell.Cell method), 78
numCol (openpyxl.drawing.text.RichTextProperties at- offset() (openpyxl.cell.interface.AbstractCell method), 79
tribute), 168 ofPieChart (openpyxl.chart.chartspace.PlotArea at-
NumData (class in openpyxl.chart.data_source), 95 tribute), 93
NumDataSource (class in openpyxl.chart.data_source),

258 Index
openpyxl Documentation, Release 2.4.0

ofPieType (openpyxl.chart.pie_chart.ProjectedPieChart openpyxl.chartsheet.tests.test_views (module), 115


attribute), 104 openpyxl.chartsheet.views (module), 120
OneCellAnchor (class in open- openpyxl.comments (module), 120
pyxl.drawing.spreadsheet_drawing), 159 openpyxl.comments.author (module), 120
oneCellAnchor (openpyxl.drawing.spreadsheet_drawing.SpreadsheetDrawing
openpyxl.comments.comments (module), 121
attribute), 160 openpyxl.comments.properties (module), 121
openpyxl (module), 1, 77 openpyxl.comments.reader (module), 122
openpyxl.cell (module), 77 openpyxl.comments.writer (module), 123
openpyxl.cell.cell (module), 77 openpyxl.descriptors (module), 123
openpyxl.cell.interface (module), 78 openpyxl.descriptors.base (module), 123
openpyxl.cell.read_only (module), 79 openpyxl.descriptors.excel (module), 125
openpyxl.cell.text (module), 79 openpyxl.descriptors.namespace (module), 126
openpyxl.chart (module), 81 openpyxl.descriptors.nested (module), 126
openpyxl.chart.area_chart (module), 81 openpyxl.descriptors.sequence (module), 127
openpyxl.chart.axis (module), 82 openpyxl.descriptors.serialisable (module), 127
openpyxl.chart.bar_chart (module), 88 openpyxl.drawing (module), 128
openpyxl.chart.bubble_chart (module), 89 openpyxl.drawing.colors (module), 128
openpyxl.chart.chartspace (module), 90 openpyxl.drawing.drawing (module), 132
openpyxl.chart.data_source (module), 95 openpyxl.drawing.effect (module), 132
openpyxl.chart.descriptors (module), 96 openpyxl.drawing.fill (module), 139
openpyxl.chart.error_bar (module), 97 openpyxl.drawing.graphic (module), 144
openpyxl.chart.label (module), 97 openpyxl.drawing.image (module), 150
openpyxl.chart.layout (module), 99 openpyxl.drawing.line (module), 150
openpyxl.chart.legend (module), 100 openpyxl.drawing.shape (module), 152
openpyxl.chart.line_chart (module), 100 openpyxl.drawing.shapes (module), 153
openpyxl.chart.marker (module), 102 openpyxl.drawing.spreadsheet_drawing (module), 158
openpyxl.chart.picture (module), 103 openpyxl.drawing.text (module), 161
openpyxl.chart.pie_chart (module), 103 openpyxl.formatting (module), 170
openpyxl.chart.radar_chart (module), 105 openpyxl.formatting.formatting (module), 170
openpyxl.chart.reference (module), 105 openpyxl.formatting.rule (module), 170
openpyxl.chart.scatter_chart (module), 106 openpyxl.packaging (module), 173
openpyxl.chart.series (module), 106 openpyxl.packaging.manifest (module), 173
openpyxl.chart.series_factory (module), 109 openpyxl.packaging.relationship (module), 174
openpyxl.chart.shapes (module), 109 openpyxl.reader (module), 174
openpyxl.chart.stock_chart (module), 110 openpyxl.reader.excel (module), 174
openpyxl.chart.surface_chart (module), 110 openpyxl.reader.strings (module), 175
openpyxl.chart.text (module), 111 openpyxl.reader.workbook (module), 175
openpyxl.chart.title (module), 112 openpyxl.reader.worksheet (module), 175
openpyxl.chart.trendline (module), 112 openpyxl.styles (module), 176
openpyxl.chart.updown_bars (module), 113 openpyxl.styles.alignment (module), 176
openpyxl.chartsheet (module), 114 openpyxl.styles.borders (module), 177
openpyxl.chartsheet.chartsheet (module), 116 openpyxl.styles.colors (module), 178
openpyxl.chartsheet.custom (module), 116 openpyxl.styles.differential (module), 179
openpyxl.chartsheet.properties (module), 117 openpyxl.styles.fills (module), 180
openpyxl.chartsheet.protection (module), 117 openpyxl.styles.fonts (module), 181
openpyxl.chartsheet.publish (module), 118 openpyxl.styles.hashable (module), 182
openpyxl.chartsheet.relation (module), 119 openpyxl.styles.named_styles (module), 182
openpyxl.chartsheet.tests (module), 114 openpyxl.styles.numbers (module), 183
openpyxl.chartsheet.tests.test_chartsheet (module), 114 openpyxl.styles.protection (module), 184
openpyxl.chartsheet.tests.test_custom (module), 114 openpyxl.styles.proxy (module), 184
openpyxl.chartsheet.tests.test_properties (module), 114 openpyxl.styles.styleable (module), 184
openpyxl.chartsheet.tests.test_protection (module), 115 openpyxl.utils (module), 185
openpyxl.chartsheet.tests.test_publish (module), 115 openpyxl.utils.bound_dictionary (module), 185
openpyxl.chartsheet.tests.test_relation (module), 115 openpyxl.utils.datetime (module), 185

Index 259
openpyxl Documentation, Release 2.4.0

openpyxl.utils.exceptions (module), 186 tribute), 211


openpyxl.utils.indexed_list (module), 186 ORIENTATION_PORTRAIT (open-
openpyxl.utils.units (module), 187 pyxl.worksheet.worksheet.Worksheet at-
openpyxl.workbook (module), 188 tribute), 211
openpyxl.workbook.child (module), 189 OuterShadowEffect (class in openpyxl.drawing.effect),
openpyxl.workbook.names (module), 188 136
openpyxl.workbook.names.external (module), 188 outerShdw (openpyxl.drawing.effect.EffectList attribute),
openpyxl.workbook.names.named_range (module), 188 134
openpyxl.workbook.properties (module), 189 Outline (class in openpyxl.worksheet.properties), 205
openpyxl.workbook.workbook (module), 192 outline (openpyxl.cell.text.InlineFont attribute), 80
openpyxl.worksheet (module), 193 outline (openpyxl.styles.borders.Border attribute), 178
openpyxl.worksheet.datavalidation (module), 193 outline (openpyxl.styles.fonts.Font attribute), 181
openpyxl.worksheet.dimensions (module), 195 outlineLevel (openpyxl.worksheet.dimensions.Dimension
openpyxl.worksheet.drawing (module), 196 attribute), 195
openpyxl.worksheet.filters (module), 196 outlinePr (openpyxl.worksheet.properties.WorksheetProperties
openpyxl.worksheet.header_footer (module), 200 attribute), 206
openpyxl.worksheet.hyperlink (module), 202 overlap (openpyxl.chart.bar_chart.BarChart attribute), 88
openpyxl.worksheet.page (module), 202 overlay (openpyxl.chart.legend.Legend attribute), 100
openpyxl.worksheet.pagebreak (module), 205 overlay (openpyxl.chart.title.Title attribute), 112
openpyxl.worksheet.properties (module), 205 Override (class in openpyxl.packaging.manifest), 173
openpyxl.worksheet.protection (module), 206 Override (openpyxl.packaging.manifest.Manifest at-
openpyxl.worksheet.read_only (module), 208 tribute), 173
openpyxl.worksheet.related (module), 209
openpyxl.worksheet.views (module), 209 P
openpyxl.worksheet.worksheet (module), 211 p (openpyxl.chart.text.RichText attribute), 111
openpyxl.writer (module), 214 PageBreak (class in openpyxl.worksheet.pagebreak), 205
openpyxl.writer.etree_worksheet (module), 214 PageMargins (class in openpyxl.worksheet.page), 202
openpyxl.writer.excel (module), 214 pageMargins (openpyxl.chart.chartspace.PrintSettings at-
openpyxl.writer.lxml_worksheet (module), 214 tribute), 94
openpyxl.writer.relations (module), 214 pageMargins (openpyxl.chartsheet.chartsheet.Chartsheet
openpyxl.writer.strings (module), 214 attribute), 116
openpyxl.writer.theme (module), 215 pageMargins (openpyxl.chartsheet.custom.CustomChartsheetView
openpyxl.writer.workbook (module), 215 attribute), 117
openpyxl.writer.worksheet (module), 215 pageOrder (openpyxl.worksheet.page.PrintPageSetup at-
openpyxl.writer.write_only (module), 215 tribute), 204
openpyxl.xml (module), 216 pageSetup (openpyxl.chart.chartspace.PrintSettings at-
openpyxl.xml.constants (module), 216 tribute), 94
openpyxl.xml.functions (module), 216 pageSetup (openpyxl.chartsheet.chartsheet.Chartsheet at-
openpyxl.xml.namespace (module), 216 tribute), 116
operator (openpyxl.formatting.rule.Rule attribute), 172 pageSetup (openpyxl.chartsheet.custom.CustomChartsheetView
operator (openpyxl.worksheet.datavalidation.DataValidation attribute), 117
attribute), 194 pageSetUpPr (openpyxl.worksheet.properties.WorksheetProperties
operator (openpyxl.worksheet.filters.CustomFilter at- attribute), 206
tribute), 197 PageSetupProperties (class in open-
options() (openpyxl.worksheet.page.PrintPageSetup pyxl.worksheet.properties), 205
method), 204 Pane (class in openpyxl.worksheet.views), 209
order (openpyxl.chart.series.Series attribute), 107 pane (openpyxl.worksheet.views.Selection attribute), 209
order (openpyxl.chart.series.XYSeries attribute), 108 pane (openpyxl.worksheet.views.SheetView attribute),
order (openpyxl.chart.trendline.Trendline attribute), 113 210
orientation (openpyxl.chart.axis.Scaling attribute), 85 panose (openpyxl.drawing.text.Font attribute), 163
orientation (openpyxl.worksheet.page.PrintPageSetup at- paperHeight (openpyxl.worksheet.page.PrintPageSetup
tribute), 204 attribute), 204
ORIENTATION_LANDSCAPE (open- paperSize (openpyxl.worksheet.page.PrintPageSetup at-
pyxl.worksheet.worksheet.Worksheet at- tribute), 204

260 Index
openpyxl Documentation, Release 2.4.0

PAPERSIZE_A3 (open- pyxl.reader.worksheet.WorkSheetParser


pyxl.worksheet.worksheet.Worksheet at- method), 175
tribute), 211 parse_data_validation() (open-
PAPERSIZE_A4 (open- pyxl.reader.worksheet.WorkSheetParser
pyxl.worksheet.worksheet.Worksheet at- method), 175
tribute), 211 parse_extensions() (open-
PAPERSIZE_A4_SMALL (open- pyxl.reader.worksheet.WorkSheetParser
pyxl.worksheet.worksheet.Worksheet at- method), 175
tribute), 211 parse_header_footer() (open-
PAPERSIZE_A5 (open- pyxl.reader.worksheet.WorkSheetParser
pyxl.worksheet.worksheet.Worksheet at- method), 175
tribute), 211 parse_legacy_drawing() (open-
PAPERSIZE_EXECUTIVE (open- pyxl.reader.worksheet.WorkSheetParser
pyxl.worksheet.worksheet.Worksheet at- method), 175
tribute), 211 parse_margins() (open-
PAPERSIZE_LEDGER (open- pyxl.reader.worksheet.WorkSheetParser
pyxl.worksheet.worksheet.Worksheet at- method), 175
tribute), 211 parse_merge() (openpyxl.reader.worksheet.WorkSheetParser
PAPERSIZE_LEGAL (open- method), 176
pyxl.worksheet.worksheet.Worksheet at- parse_page_setup() (open-
tribute), 211 pyxl.reader.worksheet.WorkSheetParser
PAPERSIZE_LETTER (open- method), 176
pyxl.worksheet.worksheet.Worksheet at- parse_print_options() (open-
tribute), 211 pyxl.reader.worksheet.WorkSheetParser
PAPERSIZE_LETTER_SMALL (open- method), 176
pyxl.worksheet.worksheet.Worksheet at- parse_properties() (open-
tribute), 211 pyxl.reader.worksheet.WorkSheetParser
PAPERSIZE_STATEMENT (open- method), 176
pyxl.worksheet.worksheet.Worksheet at- parse_ranges() (in module open-
tribute), 211 pyxl.workbook.names.external), 188
PAPERSIZE_TABLOID (open- parse_row_dimensions() (open-
pyxl.worksheet.worksheet.Worksheet at- pyxl.reader.worksheet.WorkSheetParser
tribute), 211 method), 176
paperWidth (openpyxl.worksheet.page.PrintPageSetup parse_sheet_protection() (open-
attribute), 204 pyxl.reader.worksheet.WorkSheetParser
Paragraph (class in openpyxl.drawing.text), 165 method), 176
ParagraphProperties (class in openpyxl.drawing.text), 165 parse_sheet_views() (open-
parent (openpyxl.cell.cell.Cell attribute), 78 pyxl.reader.worksheet.WorkSheetParser
parent (openpyxl.cell.read_only.ReadOnlyCell attribute), method), 176
79 parse_sort() (openpyxl.reader.worksheet.WorkSheetParser
parent (openpyxl.comments.comments.Comment at- method), 176
tribute), 121 parser_conditional_formatting() (open-
parent (openpyxl.styles.styleable.StyleableObject at- pyxl.reader.worksheet.WorkSheetParser
tribute), 184 method), 176
parse() (openpyxl.reader.worksheet.WorkSheetParser PartName (openpyxl.packaging.manifest.Override
method), 175 attribute), 173
parse_auto_filter() (open- path (openpyxl.drawing.fill.GradientFillProperties
pyxl.reader.worksheet.WorkSheetParser attribute), 142
method), 175 path (openpyxl.drawing.fill.PathShadeProperties at-
parse_books() (in module open- tribute), 142
pyxl.workbook.names.external), 188 path (openpyxl.drawing.shapes.Path2DList attribute), 155
parse_cell() (openpyxl.reader.worksheet.WorkSheetParser Path2D (class in openpyxl.drawing.shapes), 155
method), 175 Path2DList (class in openpyxl.drawing.shapes), 155
parse_column_dimensions() (open- pathLst (openpyxl.drawing.shapes.CustomGeometry2D

Index 261
openpyxl Documentation, Release 2.4.0

attribute), 154 pie3DChart (openpyxl.chart.chartspace.PlotArea at-


PathShadeProperties (class in openpyxl.drawing.fill), 142 tribute), 93
pattern (openpyxl.descriptors.excel.Base64Binary at- PieChart (class in openpyxl.chart.pie_chart), 104
tribute), 125 pieChart (openpyxl.chart.chartspace.PlotArea attribute),
pattern (openpyxl.descriptors.excel.Guid attribute), 125 94
pattern (openpyxl.descriptors.excel.HexBinary attribute), PieChart3D (class in openpyxl.chart.pie_chart), 104
125 pitchFamily (openpyxl.drawing.text.Font attribute), 164
pattern (openpyxl.descriptors.excel.Percentage attribute), pivotButton (openpyxl.styles.styleable.StyleableObject
125 attribute), 184
pattern (openpyxl.descriptors.excel.UniversalMeasure at- pivotFmt (openpyxl.chart.chartspace.PivotFormatList at-
tribute), 126 tribute), 92
pattern (openpyxl.worksheet.filters.CellRange attribute), pivotFmts (openpyxl.chart.chartspace.ChartContainer at-
197 tribute), 90
PatternFill (class in openpyxl.styles.fills), 180 PivotFormat (class in openpyxl.chart.chartspace), 92
PatternFillProperties (class in openpyxl.drawing.fill), 142 PivotFormatList (class in openpyxl.chart.chartspace), 92
patternType (openpyxl.styles.fills.PatternFill attribute), PivotSource (class in openpyxl.chart.chartspace), 92
180 pivotSource (openpyxl.chart.chartspace.ChartSpace at-
pattFill (openpyxl.chart.shapes.GraphicalProperties at- tribute), 91
tribute), 109 pivotTables (openpyxl.worksheet.protection.SheetProtection
pattFill (openpyxl.drawing.line.LineProperties attribute), attribute), 207
151 pixels_to_EMU() (in module openpyxl.utils.units), 187
pattFill (openpyxl.drawing.text.CharacterProperties at- pixels_to_points() (in module openpyxl.utils.units), 187
tribute), 163 PlotArea (class in openpyxl.chart.chartspace), 93
percent (openpyxl.formatting.rule.IconSet attribute), 171 plotArea (openpyxl.chart.chartspace.ChartContainer at-
percent (openpyxl.formatting.rule.Rule attribute), 172 tribute), 90
percent (openpyxl.worksheet.filters.Top10 attribute), 200 plotVisOnly (openpyxl.chart.chartspace.ChartContainer
Percentage (class in openpyxl.descriptors.excel), 125 attribute), 90
period (openpyxl.chart.trendline.Trendline attribute), 113 plus (openpyxl.chart.error_bar.ErrorBars attribute), 97
phoneticPr (openpyxl.cell.text.Text attribute), 81 Point2D (class in openpyxl.drawing.shapes), 155
PhoneticProperties (class in openpyxl.cell.text), 80 Point3D (class in openpyxl.drawing.shapes), 156
PhoneticText (class in openpyxl.cell.text), 80 point_pos() (openpyxl.worksheet.worksheet.Worksheet
pic (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor method), 213
attribute), 159 points_to_pixels() (in module openpyxl.utils.units), 187
pic (openpyxl.drawing.spreadsheet_drawing.OneCellAnchorpop() (openpyxl.chart.reference.Reference method), 106
attribute), 160 pos (openpyxl.drawing.fill.GradientStop attribute), 142
pic (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchorpos (openpyxl.drawing.shapes.ConnectionSite attribute),
attribute), 160 154
picLocks (openpyxl.drawing.graphic.NonVisualPictureProperties
pos (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor
attribute), 148 attribute), 159
picture (openpyxl.chartsheet.chartsheet.Chartsheet pos (openpyxl.drawing.text.TabStop attribute), 169
attribute), 116 PositiveSize2D (class in openpyxl.drawing.shapes), 156
pictureFormat (openpyxl.chart.picture.PictureOptions at- pPr (openpyxl.drawing.text.Paragraph attribute), 165
tribute), 103 pPr (openpyxl.drawing.text.TextField attribute), 169
PictureFrame (class in openpyxl.drawing.graphic), 148 preferRelativeResize (open-
PictureLocking (class in openpyxl.drawing.graphic), 149 pyxl.drawing.graphic.NonVisualPictureProperties
PictureNonVisual (class in openpyxl.drawing.graphic), attribute), 148
150 PresetGeometry2D (class in openpyxl.drawing.shapes),
PictureOptions (class in openpyxl.chart.picture), 103 156
pictureOptions (openpyxl.chart.marker.DataPoint at- PresetShadowEffect (class in openpyxl.drawing.effect),
tribute), 102 137
pictureOptions (openpyxl.chart.series.Series attribute), PresetTextShape (class in openpyxl.drawing.text), 167
107 PrintOptions (class in openpyxl.worksheet.page), 203
pictureStackUnit (openpyxl.chart.picture.PictureOptions PrintPageSetup (class in openpyxl.worksheet.page), 203
attribute), 103 PrintSettings (class in openpyxl.chart.chartspace), 94

262 Index
openpyxl Documentation, Release 2.4.0

printSettings (openpyxl.chart.chartspace.ChartSpace at- pt (openpyxl.chart.data_source.NumData attribute), 95


tribute), 91 pt (openpyxl.chart.data_source.StrData attribute), 96
priority (openpyxl.formatting.rule.Rule attribute), 172 pt (openpyxl.worksheet.pagebreak.Break attribute), 205
ProjectedPieChart (class in openpyxl.chart.pie_chart), ptCount (openpyxl.chart.data_source.NumData attribute),
104 95
prompt (openpyxl.worksheet.datavalidation.DataValidation ptCount (openpyxl.chart.data_source.StrData attribute),
attribute), 194 96
promptedSolutions (open- published (openpyxl.chartsheet.properties.ChartsheetProperties
pyxl.workbook.properties.WorkbookProperties attribute), 117
attribute), 191 published (openpyxl.worksheet.properties.WorksheetProperties
promptTitle (openpyxl.worksheet.datavalidation.DataValidation attribute), 206
attribute), 194 publishItems (openpyxl.workbook.properties.WorkbookProperties
Properties (class in openpyxl.comments.properties), 122 attribute), 191
Protection (class in openpyxl.chart.chartspace), 94
Protection (class in openpyxl.styles.protection), 184 Q
protection (openpyxl.cell.read_only.ReadOnlyCell quote_sheetname() (in module openpyxl.utils), 185
attribute), 79 quotePrefix (openpyxl.styles.styleable.StyleableObject
protection (openpyxl.chart.chartspace.ChartSpace at- attribute), 184
tribute), 91
protection (openpyxl.styles.differential.DifferentialStyle R
attribute), 179 r (openpyxl.cell.text.Text attribute), 81
protection (openpyxl.styles.named_styles.NamedStyle at- r (openpyxl.drawing.colors.RGBPercent attribute), 130
tribute), 183 r (openpyxl.drawing.fill.RelativeRect attribute), 143
protection (openpyxl.styles.Style attribute), 176 r (openpyxl.drawing.shapes.GeomRect attribute), 155
prst (openpyxl.drawing.effect.PresetShadowEffect r (openpyxl.drawing.text.Paragraph attribute), 165
attribute), 137 rad (openpyxl.drawing.effect.BlurEffect attribute), 133
prst (openpyxl.drawing.fill.PatternFillProperties at- rad (openpyxl.drawing.effect.GlowEffect attribute), 134
tribute), 142 rad (openpyxl.drawing.effect.SoftEdgesEffect attribute),
prst (openpyxl.drawing.shapes.Bevel attribute), 153 139
prst (openpyxl.drawing.shapes.Camera attribute), 154 RadarChart (class in openpyxl.chart.radar_chart), 105
prst (openpyxl.drawing.shapes.PresetGeometry2D radarChart (openpyxl.chart.chartspace.PlotArea at-
attribute), 156 tribute), 94
prst (openpyxl.drawing.text.PresetTextShape attribute), radarStyle (openpyxl.chart.radar_chart.RadarChart
167 attribute), 105
prstClr (openpyxl.drawing.colors.ColorChoice attribute), range() (openpyxl.writer.write_only.WriteOnlyWorksheet
128 method), 215
prstClr (openpyxl.drawing.effect.GlowEffect attribute), range_boundaries() (in module openpyxl.utils), 185
134 range_string (openpyxl.chart.reference.Reference at-
prstClr (openpyxl.drawing.effect.InnerShadowEffect at- tribute), 106
tribute), 135 range_to_tuple() (in module openpyxl.utils), 185
prstClr (openpyxl.drawing.effect.OuterShadowEffect at- rank (openpyxl.formatting.rule.Rule attribute), 172
tribute), 136 read_comments() (in module open-
prstClr (openpyxl.drawing.effect.PresetShadowEffect at- pyxl.comments.reader), 122
tribute), 138 read_content_types() (in module open-
prstDash (openpyxl.drawing.line.LineProperties at- pyxl.reader.workbook), 175
tribute), 151 read_dimension() (in module open-
prstGeom (openpyxl.chart.shapes.GraphicalProperties at- pyxl.worksheet.read_only), 208
tribute), 109 read_named_ranges() (in module open-
prstMaterial (openpyxl.drawing.shapes.Shape3D at- pyxl.workbook.names.named_range), 189
tribute), 157 read_only (openpyxl.workbook.workbook.Workbook at-
prstShdw (openpyxl.drawing.effect.EffectList attribute), tribute), 192
134 read_rels() (in module openpyxl.reader.workbook), 175
prstTxWarp (openpyxl.drawing.text.RichTextProperties read_sheets() (in module openpyxl.reader.workbook),
attribute), 168 175

Index 263
openpyxl Documentation, Release 2.4.0

read_string_table() (in module openpyxl.reader.strings), method), 193


175 removed_method() (in module open-
readingOrder (openpyxl.styles.alignment.Alignment at- pyxl.writer.write_only), 216
tribute), 177 repair_central_directory() (in module open-
ReadOnlyCell (class in openpyxl.cell.read_only), 79 pyxl.reader.excel), 175
ReadOnlyWorkbookException, 186 REPLACE_LIST (open-
ReadOnlyWorksheet (class in open- pyxl.worksheet.header_footer.HeaderFooterItem
pyxl.worksheet.read_only), 208 attribute), 202
RECT (openpyxl.drawing.shape.Shape attribute), 152 repr_format (openpyxl.workbook.names.named_range.NamedRange
rect (openpyxl.drawing.shapes.CustomGeometry2D at- attribute), 189
tribute), 154 rev (openpyxl.drawing.shapes.SphereCoords attribute),
red (openpyxl.drawing.colors.SystemColor attribute), 131 158
redMod (openpyxl.drawing.colors.SystemColor at- reverse (openpyxl.formatting.rule.IconSet attribute), 171
tribute), 131 rfe (openpyxl.chartsheet.relation.DrawingHF attribute),
redOff (openpyxl.drawing.colors.SystemColor attribute), 119
131 rff (openpyxl.chartsheet.relation.DrawingHF attribute),
ref (openpyxl.comments.properties.Comment attribute), 119
121 rfo (openpyxl.chartsheet.relation.DrawingHF attribute),
ref (openpyxl.worksheet.filters.AutoFilter attribute), 197 119
ref (openpyxl.worksheet.filters.SortCondition attribute), rFont (openpyxl.cell.text.InlineFont attribute), 80
200 RGB (class in openpyxl.styles.colors), 179
ref (openpyxl.worksheet.filters.SortState attribute), 200 rgb (openpyxl.styles.colors.Color attribute), 178
ref (openpyxl.worksheet.hyperlink.Hyperlink attribute), rgb (openpyxl.styles.colors.RgbColor attribute), 179
202 RgbColor (class in openpyxl.styles.colors), 179
Reference (class in openpyxl.chart.reference), 105 rgbColor (openpyxl.styles.colors.IndexedColorList at-
refers_to_range() (in module open- tribute), 179
pyxl.workbook.names.named_range), 189 RGBPercent (class in openpyxl.drawing.colors), 130
refersTo (openpyxl.workbook.names.external.ExternalRangerhe (openpyxl.chartsheet.relation.DrawingHF attribute),
attribute), 188 119
reflection (openpyxl.drawing.effect.EffectList attribute), rhf (openpyxl.chartsheet.relation.DrawingHF attribute),
134 119
ReflectionEffect (class in openpyxl.drawing.effect), 138 rho (openpyxl.chartsheet.relation.DrawingHF attribute),
refMode (openpyxl.workbook.properties.CalcProperties 120
attribute), 190 rich (openpyxl.chart.text.Text attribute), 112
refreshAllConnections (open- RichText (class in openpyxl.cell.text), 81
pyxl.workbook.properties.WorkbookProperties RichText (class in openpyxl.chart.text), 111
attribute), 191 RichTextProperties (class in openpyxl.drawing.text), 167
RegularTextRun (class in openpyxl.drawing.text), 167 rig (openpyxl.drawing.shapes.LightRig attribute), 155
Related (class in openpyxl.worksheet.related), 209 right (openpyxl.styles.borders.Border attribute), 178
Relation (class in openpyxl.descriptors.excel), 125 right (openpyxl.styles.fills.GradientFill attribute), 180
Relationship (class in openpyxl.packaging.relationship), RIGHT (openpyxl.worksheet.header_footer.HeaderFooterItem
174 attribute), 202
Relationship (openpyxl.packaging.relationship.RelationshipList
right (openpyxl.worksheet.page.PageMargins attribute),
attribute), 174 203
RelationshipList (class in open- right_footer (openpyxl.worksheet.header_footer.HeaderFooter
pyxl.packaging.relationship), 174 attribute), 201
relativeIndent (openpyxl.styles.alignment.Alignment at- right_header (openpyxl.worksheet.header_footer.HeaderFooter
tribute), 177 attribute), 201
RelativeRect (class in openpyxl.drawing.fill), 143 rightToLeft (openpyxl.worksheet.views.SheetView
RelId (class in openpyxl.chart.chartspace), 95 attribute), 210
remove_named_range() (open- rIns (openpyxl.drawing.text.RichTextProperties at-
pyxl.workbook.workbook.Workbook method), tribute), 168
193 rot (openpyxl.drawing.graphic.GroupTransform2D at-
remove_sheet() (openpyxl.workbook.workbook.Workbook tribute), 147

264 Index
openpyxl Documentation, Release 2.4.0

rot (openpyxl.drawing.shapes.Camera attribute), 154 S


rot (openpyxl.drawing.shapes.LightRig attribute), 155 safe_iterator() (in module openpyxl.xml.functions), 216
rot (openpyxl.drawing.shapes.Transform2D attribute), safe_iterparse() (in module openpyxl.xml.functions), 216
158 saltValue (openpyxl.chartsheet.protection.ChartsheetProtection
rot (openpyxl.drawing.text.RichTextProperties attribute), attribute), 118
168 saltValue (openpyxl.worksheet.protection.SheetProtection
rotWithShape (openpyxl.drawing.effect.OuterShadowEffect attribute), 207
attribute), 137 sat (openpyxl.drawing.colors.HSLColor attribute), 130
rotWithShape (openpyxl.drawing.effect.ReflectionEffect sat (openpyxl.drawing.colors.SystemColor attribute), 131
attribute), 139 sat (openpyxl.drawing.effect.HSLEffect attribute), 135
rotWithShape (openpyxl.drawing.fill.BlipFillProperties satMod (openpyxl.drawing.colors.SystemColor at-
attribute), 141 tribute), 131
rotWithShape (openpyxl.drawing.fill.GradientFillProperties satOff (openpyxl.drawing.colors.SystemColor attribute),
attribute), 142 131
round (openpyxl.drawing.line.LineProperties attribute), save() (openpyxl.workbook.workbook.Workbook
151 method), 193
ROUND_RECT (openpyxl.drawing.shape.Shape at- save() (openpyxl.writer.excel.ExcelWriter method), 214
tribute), 153 save_dump() (in module openpyxl.writer.write_only),
roundedCorners (openpyxl.chart.chartspace.ChartSpace 216
attribute), 91 save_virtual_workbook() (in module open-
row (openpyxl.cell.cell.Cell attribute), 78 pyxl.writer.excel), 214
row (openpyxl.cell.read_only.ReadOnlyCell attribute), 79 save_workbook() (in module openpyxl.writer.excel), 214
row (openpyxl.drawing.spreadsheet_drawing.AnchorMarkersaveExternalLinkValues (open-
attribute), 159 pyxl.workbook.properties.WorkbookProperties
RowDimension (class in open- attribute), 191
pyxl.worksheet.dimensions), 196 sb (openpyxl.cell.text.PhoneticText attribute), 80
rowHidden (openpyxl.comments.properties.Properties at- scale (openpyxl.chartsheet.custom.CustomChartsheetView
tribute), 122 attribute), 117
rowOff (openpyxl.drawing.spreadsheet_drawing.AnchorMarker scale (openpyxl.worksheet.page.PrintPageSetup at-
attribute), 159 tribute), 204
rows (openpyxl.chart.reference.Reference attribute), 106 scaled (openpyxl.drawing.fill.LinearShadeProperties at-
rows (openpyxl.worksheet.read_only.ReadOnlyWorksheet tribute), 142
attribute), 208 Scaling (class in openpyxl.chart.axis), 85
rows (openpyxl.worksheet.worksheet.Worksheet at- scaling (openpyxl.chart.axis.DateAxis attribute), 83
tribute), 213 scaling (openpyxl.chart.axis.NumericAxis attribute), 85
rows_from_range() (in module openpyxl.utils), 185 scaling (openpyxl.chart.axis.SeriesAxis attribute), 86
rPh (openpyxl.cell.text.Text attribute), 81 scaling (openpyxl.chart.axis.TextAxis attribute), 87
rPr (openpyxl.cell.text.RichText attribute), 81 ScatterChart (class in openpyxl.chart.scatter_chart), 106
rPr (openpyxl.drawing.text.LineBreak attribute), 164 scatterChart (openpyxl.chart.chartspace.PlotArea at-
rPr (openpyxl.drawing.text.RegularTextRun attribute), tribute), 94
167 scatterStyle (openpyxl.chart.scatter_chart.ScatterChart
rPr (openpyxl.drawing.text.TextField attribute), 170 attribute), 106
rtl (openpyxl.drawing.text.CharacterProperties attribute), scenarios (openpyxl.worksheet.protection.SheetProtection
163 attribute), 208
rtl (openpyxl.drawing.text.ParagraphProperties attribute), Scene3D (class in openpyxl.drawing.shapes), 157
167 scene3d (openpyxl.chart.shapes.GraphicalProperties at-
rtlCol (openpyxl.drawing.text.RichTextProperties at- tribute), 109
tribute), 168 scene3d (openpyxl.drawing.graphic.GroupShapeProperties
Rule (class in openpyxl.formatting.rule), 172 attribute), 146
RuleType (class in openpyxl.formatting.rule), 173 scene3d (openpyxl.drawing.text.RichTextProperties at-
rupBuild (openpyxl.workbook.properties.FileVersion at- tribute), 169
tribute), 190 scheme (openpyxl.cell.text.InlineFont attribute), 80
scheme (openpyxl.styles.fonts.Font attribute), 181

Index 265
openpyxl Documentation, Release 2.4.0

schemeClr (openpyxl.drawing.colors.ColorChoice ser (openpyxl.chart.bubble_chart.BubbleChart attribute),


attribute), 128 89
schemeClr (openpyxl.drawing.effect.GlowEffect at- ser (openpyxl.chart.line_chart.LineChart attribute), 101
tribute), 134 ser (openpyxl.chart.line_chart.LineChart3D attribute),
schemeClr (openpyxl.drawing.effect.InnerShadowEffect 101
attribute), 136 ser (openpyxl.chart.pie_chart.DoughnutChart attribute),
schemeClr (openpyxl.drawing.effect.OuterShadowEffect 103
attribute), 137 ser (openpyxl.chart.pie_chart.PieChart attribute), 104
schemeClr (openpyxl.drawing.effect.PresetShadowEffect ser (openpyxl.chart.pie_chart.PieChart3D attribute), 104
attribute), 138 ser (openpyxl.chart.pie_chart.ProjectedPieChart at-
scope (openpyxl.workbook.names.named_range.NamedRange tribute), 105
attribute), 189 ser (openpyxl.chart.radar_chart.RadarChart attribute),
scope (openpyxl.workbook.names.named_range.NamedValue 105
attribute), 189 ser (openpyxl.chart.scatter_chart.ScatterChart attribute),
scrgbClr (openpyxl.drawing.colors.ColorChoice at- 106
tribute), 128 ser (openpyxl.chart.stock_chart.StockChart attribute),
scrgbClr (openpyxl.drawing.effect.GlowEffect attribute), 110
135 ser (openpyxl.chart.surface_chart.SurfaceChart attribute),
scrgbClr (openpyxl.drawing.effect.InnerShadowEffect at- 111
tribute), 136 ser (openpyxl.chart.surface_chart.SurfaceChart3D
scrgbClr (openpyxl.drawing.effect.OuterShadowEffect attribute), 111
attribute), 137 serAx (openpyxl.chart.chartspace.PlotArea attribute), 94
scrgbClr (openpyxl.drawing.effect.PresetShadowEffect Serialisable (class in openpyxl.descriptors.serialisable),
attribute), 138 127
second (openpyxl.worksheet.filters.DateGroupItem at- Series (class in openpyxl.chart.series), 106
tribute), 198 SeriesAxis (class in openpyxl.chart.axis), 85
secondPiePt (openpyxl.chart.pie_chart.CustomSplit at- SeriesFactory() (in module open-
tribute), 103 pyxl.chart.series_factory), 109
secondPieSize (openpyxl.chart.pie_chart.ProjectedPieChart SeriesLabel (class in openpyxl.chart.series), 108
attribute), 105 serLines (openpyxl.chart.bar_chart.BarChart attribute),
selected_cell (openpyxl.worksheet.worksheet.Worksheet 88
attribute), 213 serLines (openpyxl.chart.bar_chart.BarChart3D at-
Selection (class in openpyxl.worksheet.views), 209 tribute), 89
selection (openpyxl.chart.chartspace.Protection attribute), serLines (openpyxl.chart.pie_chart.ProjectedPieChart at-
94 tribute), 105
selection (openpyxl.worksheet.views.SheetView at- Set (class in openpyxl.descriptors.base), 124
tribute), 210 set() (openpyxl.worksheet.header_footer.HeaderFooterItem
selectLockedCells (open- method), 202
pyxl.worksheet.protection.SheetProtection set_dimension() (openpyxl.drawing.drawing.Drawing
attribute), 208 method), 132
selectUnlockedCells (open- set_explicit_value() (openpyxl.cell.cell.Cell method), 78
pyxl.worksheet.protection.SheetProtection set_password() (openpyxl.worksheet.protection.SheetProtection
attribute), 208 method), 208
separator (openpyxl.chart.label.DataLabel attribute), 98 set_printer_settings() (open-
separator (openpyxl.chart.label.DataLabelList attribute), pyxl.worksheet.worksheet.Worksheet method),
98 213
seq_types (openpyxl.descriptors.sequence.Sequence at- setDxfStyles() (openpyxl.formatting.formatting.ConditionalFormatting
tribute), 127 method), 170
Sequence (class in openpyxl.descriptors.sequence), 127 setFooter() (openpyxl.worksheet.header_footer.HeaderFooter
ser (openpyxl.chart.area_chart.AreaChart attribute), 81 method), 201
ser (openpyxl.chart.area_chart.AreaChart3D attribute), setHeader() (openpyxl.worksheet.header_footer.HeaderFooter
82 method), 201
ser (openpyxl.chart.bar_chart.BarChart attribute), 88 setup() (openpyxl.worksheet.page.PrintPageSetup
ser (openpyxl.chart.bar_chart.BarChart3D attribute), 89 method), 204

266 Index
openpyxl Documentation, Release 2.4.0

shade (openpyxl.drawing.colors.SystemColor attribute), show_gridlines (openpyxl.worksheet.worksheet.Worksheet


131 attribute), 213
shadow (openpyxl.cell.text.InlineFont attribute), 80 show_summary_below (open-
shadow (openpyxl.styles.fonts.Font attribute), 181 pyxl.worksheet.worksheet.Worksheet at-
Shape (class in openpyxl.drawing.shape), 152 tribute), 213
shape (openpyxl.chart.bar_chart.BarChart3D attribute), show_summary_right (open-
89 pyxl.worksheet.worksheet.Worksheet at-
shape (openpyxl.chart.series.Series attribute), 107 tribute), 213
Shape3D (class in openpyxl.drawing.shapes), 157 showBorderUnselectedTables (open-
shapeId (openpyxl.comments.properties.Comment pyxl.workbook.properties.WorkbookProperties
attribute), 121 attribute), 191
ShapeStyle (class in openpyxl.drawing.shapes), 157 showBubbleSize (openpyxl.chart.label.DataLabel at-
ShapeWriter (class in openpyxl.drawing.shape), 153 tribute), 98
shared_strings (openpyxl.cell.read_only.ReadOnlyCell showBubbleSize (openpyxl.chart.label.DataLabelList at-
attribute), 79 tribute), 98
sheet (openpyxl.worksheet.protection.SheetProtection at- showButton (openpyxl.worksheet.filters.FilterColumn at-
tribute), 208 tribute), 199
sheet_properties (open- showCatName (openpyxl.chart.label.DataLabel at-
pyxl.worksheet.page.PrintPageSetup attribute), tribute), 98
204 showCatName (openpyxl.chart.label.DataLabelList at-
sheet_state (openpyxl.chartsheet.chartsheet.Chartsheet tribute), 98
attribute), 116 showDLblsOverMax (open-
SheetBackgroundPicture (class in open- pyxl.chart.chartspace.ChartContainer at-
pyxl.chartsheet.relation), 120 tribute), 90
SheetBackgroundPicture() (in module open- showDropDown (open-
pyxl.chartsheet.tests.test_relation), 115 pyxl.worksheet.datavalidation.DataValidation
sheetId (openpyxl.workbook.names.external.ExternalRange attribute), 194
attribute), 188 showErrorMessage (open-
sheetname (openpyxl.chart.reference.Reference at- pyxl.worksheet.datavalidation.DataValidation
tribute), 106 attribute), 194
sheetnames (openpyxl.workbook.workbook.Workbook showFormulas (openpyxl.worksheet.views.SheetView at-
attribute), 193 tribute), 210
sheetPr (openpyxl.chartsheet.chartsheet.Chartsheet showGridLines (openpyxl.worksheet.views.SheetView
attribute), 116 attribute), 210
SheetProtection (class in openpyxl.worksheet.protection), showHorzBorder (openpyxl.chart.chartspace.DataTable
206 attribute), 91
sheetProtection (openpyxl.chartsheet.chartsheet.Chartsheet showInkAnnotation (open-
attribute), 116 pyxl.workbook.properties.WorkbookProperties
SHEETSTATE_HIDDEN (open- attribute), 192
pyxl.worksheet.worksheet.Worksheet at- showInputMessage (open-
tribute), 211 pyxl.worksheet.datavalidation.DataValidation
SHEETSTATE_VERYHIDDEN (open- attribute), 194
pyxl.worksheet.worksheet.Worksheet at- showKeys (openpyxl.chart.chartspace.DataTable at-
tribute), 211 tribute), 91
SHEETSTATE_VISIBLE (open- showLeaderLines (openpyxl.chart.label.DataLabel
pyxl.worksheet.worksheet.Worksheet at- attribute), 98
tribute), 211 showLeaderLines (openpyxl.chart.label.DataLabelList at-
SheetTitleException, 186 tribute), 99
SheetView (class in openpyxl.worksheet.views), 209 showLegendKey (openpyxl.chart.label.DataLabel at-
sheetView (openpyxl.chartsheet.views.ChartsheetViewList tribute), 98
attribute), 120 showLegendKey (openpyxl.chart.label.DataLabelList at-
sheetViews (openpyxl.chartsheet.chartsheet.Chartsheet tribute), 99
attribute), 116 showNegBubbles (open-
short_color() (in module openpyxl.utils.units), 187 pyxl.chart.bubble_chart.BubbleChart attribute),

Index 267
openpyxl Documentation, Release 2.4.0

89 smooth (openpyxl.chart.line_chart.LineChart3D at-


showObjects (openpyxl.workbook.properties.WorkbookProperties tribute), 102
attribute), 192 smooth (openpyxl.chart.series.Series attribute), 107
showOutline (openpyxl.chart.chartspace.DataTable at- smooth (openpyxl.chart.series.XYSeries attribute), 108
tribute), 92 smtClean (openpyxl.drawing.text.CharacterProperties at-
showOutlineSymbols (open- tribute), 163
pyxl.worksheet.properties.Outline attribute), smtId (openpyxl.drawing.text.CharacterProperties at-
205 tribute), 163
showOutlineSymbols (open- snd (openpyxl.drawing.text.Hyperlink attribute), 164
pyxl.worksheet.views.SheetView attribute), softEdge (openpyxl.drawing.effect.EffectList attribute),
210 134
showPercent (openpyxl.chart.label.DataLabel attribute), SoftEdgesEffect (class in openpyxl.drawing.effect), 139
98 solidFill (openpyxl.chart.shapes.GraphicalProperties at-
showPercent (openpyxl.chart.label.DataLabelList at- tribute), 109
tribute), 99 solidFill (openpyxl.drawing.line.LineProperties at-
showPivotChartFilter (open- tribute), 152
pyxl.workbook.properties.WorkbookProperties solidFill (openpyxl.drawing.text.CharacterProperties at-
attribute), 192 tribute), 163
showRowColHeaders (open- sort (openpyxl.worksheet.protection.SheetProtection at-
pyxl.worksheet.views.SheetView attribute), tribute), 208
210 sortBy (openpyxl.worksheet.filters.SortCondition at-
showRuler (openpyxl.worksheet.views.SheetView tribute), 200
attribute), 210 SortCondition (class in openpyxl.worksheet.filters), 199
showSerName (openpyxl.chart.label.DataLabel attribute), sortCondition (openpyxl.worksheet.filters.SortState at-
98 tribute), 200
showSerName (openpyxl.chart.label.DataLabelList at- sortMethod (openpyxl.worksheet.filters.SortState at-
tribute), 99 tribute), 200
showVal (openpyxl.chart.label.DataLabel attribute), 98 SortState (class in openpyxl.worksheet.filters), 200
showVal (openpyxl.chart.label.DataLabelList attribute), sortState (openpyxl.worksheet.filters.AutoFilter at-
99 tribute), 197
showValue (openpyxl.formatting.rule.DataBar attribute), sourceLinked (openpyxl.chart.data_source.NumFmt at-
171 tribute), 95
showValue (openpyxl.formatting.rule.IconSet attribute), sourceObject (openpyxl.chartsheet.publish.WebPublishItem
171 attribute), 118
showVertBorder (openpyxl.chart.chartspace.DataTable sourceRef (openpyxl.chartsheet.publish.WebPublishItem
attribute), 92 attribute), 118
showWhiteSpace (openpyxl.worksheet.views.SheetView sourceType (openpyxl.chartsheet.publish.WebPublishItem
attribute), 210 attribute), 118
showZeros (openpyxl.worksheet.views.SheetView sp (openpyxl.drawing.line.DashStop attribute), 150
attribute), 210 sp (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor
shrinkToFit (openpyxl.styles.alignment.Alignment attribute), 159
attribute), 177 sp (openpyxl.drawing.spreadsheet_drawing.OneCellAnchor
Side (class in openpyxl.styles.borders), 178 attribute), 160
sideWall (openpyxl.chart.bar_chart.BarChart3D at- sp (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor
tribute), 89 attribute), 161
sideWall (openpyxl.chart.chartspace.ChartContainer at- sp3d (openpyxl.chart.shapes.GraphicalProperties at-
tribute), 90 tribute), 110
size (openpyxl.chart.marker.Marker attribute), 102 Spacing (class in openpyxl.drawing.text), 169
sizeRepresents (openpyxl.chart.bubble_chart.BubbleChart spAutoFit (openpyxl.drawing.text.RichTextProperties at-
attribute), 89 tribute), 169
sizeWithCells (openpyxl.comments.properties.ObjectAnchorspc (openpyxl.drawing.text.CharacterProperties at-
attribute), 121 tribute), 163
smooth (openpyxl.chart.line_chart.LineChart attribute), spcAft (openpyxl.drawing.text.ParagraphProperties at-
101 tribute), 167

268 Index
openpyxl Documentation, Release 2.4.0

spcBef (openpyxl.drawing.text.ParagraphProperties at- srcRect (openpyxl.drawing.fill.BlipFillProperties at-


tribute), 167 tribute), 141
spcCol (openpyxl.drawing.text.RichTextProperties srgbClr (openpyxl.drawing.colors.ColorChoice attribute),
attribute), 169 128
spcFirstLastPara (open- srgbClr (openpyxl.drawing.effect.GlowEffect attribute),
pyxl.drawing.text.RichTextProperties at- 135
tribute), 169 srgbClr (openpyxl.drawing.effect.InnerShadowEffect at-
spcPct (openpyxl.drawing.text.Spacing attribute), 169 tribute), 136
spcPts (openpyxl.drawing.text.Spacing attribute), 169 srgbClr (openpyxl.drawing.effect.OuterShadowEffect at-
SphereCoords (class in openpyxl.drawing.shapes), 158 tribute), 137
spinCount (openpyxl.chartsheet.protection.ChartsheetProtection
srgbClr (openpyxl.drawing.effect.PresetShadowEffect at-
attribute), 118 tribute), 138
spinCount (openpyxl.worksheet.protection.SheetProtection stA (openpyxl.drawing.effect.ReflectionEffect attribute),
attribute), 208 139
split_named_range() (in module open- start (openpyxl.styles.borders.Border attribute), 178
pyxl.workbook.names.named_range), 189 startAt (openpyxl.drawing.text.AutonumberBullet at-
splitPos (openpyxl.chart.pie_chart.ProjectedPieChart at- tribute), 161
tribute), 105 state (openpyxl.chartsheet.custom.CustomChartsheetView
splitType (openpyxl.chart.pie_chart.ProjectedPieChart at- attribute), 117
tribute), 105 state (openpyxl.worksheet.views.Pane attribute), 209
spPr (openpyxl.chart.axis.ChartLines attribute), 82 stCxn (openpyxl.drawing.graphic.NonVisualConnectorProperties
spPr (openpyxl.chart.axis.DateAxis attribute), 83 attribute), 147
spPr (openpyxl.chart.axis.DisplayUnitsLabel attribute), stdDev (openpyxl.formatting.rule.Rule attribute), 172
84 StockChart (class in openpyxl.chart.stock_chart), 110
spPr (openpyxl.chart.axis.NumericAxis attribute), 85 stockChart (openpyxl.chart.chartspace.PlotArea at-
spPr (openpyxl.chart.axis.SeriesAxis attribute), 86 tribute), 94
spPr (openpyxl.chart.axis.TextAxis attribute), 87 stop (openpyxl.styles.fills.GradientFill attribute), 180
spPr (openpyxl.chart.chartspace.ChartSpace attribute), 91 stopIfTrue (openpyxl.formatting.rule.Rule attribute), 172
spPr (openpyxl.chart.chartspace.DataTable attribute), 92 stPos (openpyxl.drawing.effect.ReflectionEffect at-
spPr (openpyxl.chart.chartspace.PivotFormat attribute), tribute), 139
92 str_format (openpyxl.workbook.names.named_range.NamedRange
spPr (openpyxl.chart.chartspace.PlotArea attribute), 94 attribute), 189
spPr (openpyxl.chart.error_bar.ErrorBars attribute), 97 strCache (openpyxl.chart.data_source.StrRef attribute),
spPr (openpyxl.chart.label.DataLabel attribute), 98 96
spPr (openpyxl.chart.label.DataLabelList attribute), 99 StrData (class in openpyxl.chart.data_source), 96
spPr (openpyxl.chart.legend.Legend attribute), 100 stretch (openpyxl.drawing.fill.BlipFillProperties at-
spPr (openpyxl.chart.marker.DataPoint attribute), 102 tribute), 141
spPr (openpyxl.chart.marker.Marker attribute), 102 StretchInfoProperties (class in openpyxl.drawing.fill),
spPr (openpyxl.chart.series.Series attribute), 107 143
spPr (openpyxl.chart.series.XYSeries attribute), 108 Strict (class in openpyxl.descriptors), 123
spPr (openpyxl.chart.surface_chart.BandFormat at- strike (openpyxl.cell.text.InlineFont attribute), 80
tribute), 110 strike (openpyxl.drawing.text.CharacterProperties at-
spPr (openpyxl.chart.title.Title attribute), 112 tribute), 163
spPr (openpyxl.chart.trendline.Trendline attribute), 113 strike (openpyxl.styles.fonts.Font attribute), 181
spPr (openpyxl.chart.trendline.TrendlineLabel attribute), String (class in openpyxl.descriptors.base), 124
113 strLit (openpyxl.chart.data_source.AxDataSource at-
spPr (openpyxl.drawing.graphic.Connector attribute), 144 tribute), 95
spPr (openpyxl.drawing.graphic.PictureFrame attribute), stroke (openpyxl.drawing.shapes.Path2D attribute), 155
149 StrRef (class in openpyxl.chart.data_source), 96
SpreadsheetDrawing (class in open- strRef (openpyxl.chart.data_source.AxDataSource
pyxl.drawing.spreadsheet_drawing), 160 attribute), 95
sqref (openpyxl.worksheet.datavalidation.DataValidation strRef (openpyxl.chart.series.SeriesLabel attribute), 108
attribute), 194 strRef (openpyxl.chart.text.Text attribute), 112
sqref (openpyxl.worksheet.views.Selection attribute), 209 StrVal (class in openpyxl.chart.data_source), 96

Index 269
openpyxl Documentation, Release 2.4.0

Style (class in openpyxl.styles), 176 sysClr (openpyxl.drawing.colors.ColorChoice attribute),


style (openpyxl.cell.interface.AbstractCell attribute), 79 128
style (openpyxl.cell.read_only.ReadOnlyCell attribute), sysClr (openpyxl.drawing.effect.GlowEffect attribute),
79 135
style (openpyxl.chart.chartspace.ChartSpace attribute), sysClr (openpyxl.drawing.effect.InnerShadowEffect at-
91 tribute), 136
style (openpyxl.drawing.graphic.Connector attribute), sysClr (openpyxl.drawing.effect.OuterShadowEffect at-
144 tribute), 137
style (openpyxl.drawing.graphic.PictureFrame attribute), sysClr (openpyxl.drawing.effect.PresetShadowEffect at-
149 tribute), 138
style (openpyxl.styles.borders.Side attribute), 178 SystemColor (class in openpyxl.drawing.colors), 130
style (openpyxl.styles.styleable.StyleableObject at- sz (openpyxl.cell.text.InlineFont attribute), 80
tribute), 184 sz (openpyxl.drawing.text.CharacterProperties attribute),
style_array (openpyxl.cell.read_only.ReadOnlyCell at- 163
tribute), 79 sz (openpyxl.styles.fonts.Font attribute), 181
style_id (openpyxl.styles.styleable.StyleableObject at-
tribute), 184 T
StyleableObject (class in openpyxl.styles.styleable), 184 t (openpyxl.cell.text.PhoneticText attribute), 81
StyleDescriptor (class in openpyxl.styles.styleable), 184 t (openpyxl.cell.text.RichText attribute), 81
StyleMatrixReference (class in open- t (openpyxl.cell.text.Text attribute), 81
pyxl.drawing.shapes), 158 t (openpyxl.drawing.fill.RelativeRect attribute), 143
StyleProxy (class in openpyxl.styles.proxy), 184 t (openpyxl.drawing.shapes.GeomRect attribute), 155
summaryBelow (openpyxl.worksheet.properties.Outline t (openpyxl.drawing.text.RegularTextRun attribute), 167
attribute), 205 t (openpyxl.drawing.text.TextField attribute), 170
summaryRight (openpyxl.worksheet.properties.Outline tab (openpyxl.drawing.text.TabStopList attribute), 169
attribute), 205 tabColor (openpyxl.chartsheet.properties.ChartsheetProperties
surface3DChart (openpyxl.chart.chartspace.PlotArea at- attribute), 117
tribute), 94 tabColor (openpyxl.worksheet.properties.WorksheetProperties
SurfaceChart (class in openpyxl.chart.surface_chart), 110 attribute), 206
surfaceChart (openpyxl.chart.chartspace.PlotArea at- tabLst (openpyxl.drawing.text.ParagraphProperties at-
tribute), 94 tribute), 167
SurfaceChart3D (class in openpyxl.chart.surface_chart), tabSelected (openpyxl.chartsheet.views.ChartsheetView
111 attribute), 120
sx (openpyxl.drawing.effect.OuterShadowEffect at- tabSelected (openpyxl.worksheet.views.SheetView
tribute), 137 attribute), 210
sx (openpyxl.drawing.effect.ReflectionEffect attribute), TabStop (class in openpyxl.drawing.text), 169
139 TabStopList (class in openpyxl.drawing.text), 169
sx (openpyxl.drawing.fill.TileInfoProperties attribute), tag (openpyxl.worksheet.page.PrintOptions attribute),
143 203
sy (openpyxl.drawing.effect.OuterShadowEffect at- tag (openpyxl.worksheet.properties.Outline attribute),
tribute), 137 205
sy (openpyxl.drawing.effect.ReflectionEffect attribute), tag (openpyxl.worksheet.properties.PageSetupProperties
139 attribute), 206
sy (openpyxl.drawing.fill.TileInfoProperties attribute), tag (openpyxl.worksheet.properties.WorksheetProperties
143 attribute), 206
sym (openpyxl.drawing.text.CharacterProperties at- tagname (openpyxl.cell.text.InlineFont attribute), 80
tribute), 163 tagname (openpyxl.cell.text.RichText attribute), 81
symbol (openpyxl.chart.marker.Marker attribute), 103 tagname (openpyxl.cell.text.Text attribute), 81
syncHorizontal (openpyxl.worksheet.properties.WorksheetProperties
tagname (openpyxl.chart.area_chart.AreaChart attribute),
attribute), 206 81
syncRef (openpyxl.worksheet.properties.WorksheetProperties tagname (openpyxl.chart.area_chart.AreaChart3D at-
attribute), 206 tribute), 82
syncVertical (openpyxl.worksheet.properties.WorksheetProperties
tagname (openpyxl.chart.axis.ChartLines attribute), 82
attribute), 206 tagname (openpyxl.chart.axis.DateAxis attribute), 83

270 Index
openpyxl Documentation, Release 2.4.0

tagname (openpyxl.chart.axis.DisplayUnitsLabel at- tagname (openpyxl.chart.marker.DataPoint attribute), 102


tribute), 84 tagname (openpyxl.chart.marker.Marker attribute), 103
tagname (openpyxl.chart.axis.DisplayUnitsLabelList at- tagname (openpyxl.chart.picture.PictureOptions at-
tribute), 84 tribute), 103
tagname (openpyxl.chart.axis.NumericAxis attribute), 85 tagname (openpyxl.chart.pie_chart.CustomSplit at-
tagname (openpyxl.chart.axis.Scaling attribute), 85 tribute), 103
tagname (openpyxl.chart.axis.SeriesAxis attribute), 86 tagname (openpyxl.chart.pie_chart.DoughnutChart
tagname (openpyxl.chart.axis.TextAxis attribute), 87 attribute), 103
tagname (openpyxl.chart.bar_chart.BarChart attribute), tagname (openpyxl.chart.pie_chart.PieChart attribute),
88 104
tagname (openpyxl.chart.bar_chart.BarChart3D at- tagname (openpyxl.chart.pie_chart.PieChart3D attribute),
tribute), 89 104
tagname (openpyxl.chart.bubble_chart.BubbleChart at- tagname (openpyxl.chart.pie_chart.ProjectedPieChart at-
tribute), 90 tribute), 105
tagname (openpyxl.chart.chartspace.ChartContainer at- tagname (openpyxl.chart.radar_chart.RadarChart at-
tribute), 90 tribute), 105
tagname (openpyxl.chart.chartspace.ChartSpace at- tagname (openpyxl.chart.scatter_chart.ScatterChart at-
tribute), 91 tribute), 106
tagname (openpyxl.chart.chartspace.DataTable attribute), tagname (openpyxl.chart.series.Series attribute), 107
92 tagname (openpyxl.chart.series.SeriesLabel attribute),
tagname (openpyxl.chart.chartspace.ExternalData at- 108
tribute), 92 tagname (openpyxl.chart.shapes.GraphicalProperties at-
tagname (openpyxl.chart.chartspace.PivotFormat at- tribute), 110
tribute), 92 tagname (openpyxl.chart.stock_chart.StockChart at-
tagname (openpyxl.chart.chartspace.PivotFormatList at- tribute), 110
tribute), 92 tagname (openpyxl.chart.surface_chart.BandFormat at-
tagname (openpyxl.chart.chartspace.PivotSource at- tribute), 110
tribute), 93 tagname (openpyxl.chart.surface_chart.BandFormatList
tagname (openpyxl.chart.chartspace.PlotArea attribute), attribute), 110
94 tagname (openpyxl.chart.surface_chart.SurfaceChart at-
tagname (openpyxl.chart.chartspace.PrintSettings at- tribute), 111
tribute), 94 tagname (openpyxl.chart.surface_chart.SurfaceChart3D
tagname (openpyxl.chart.chartspace.Protection attribute), attribute), 111
94 tagname (openpyxl.chart.text.RichText attribute), 111
tagname (openpyxl.chart.data_source.StrData attribute), tagname (openpyxl.chart.title.Title attribute), 112
96 tagname (openpyxl.chart.trendline.Trendline attribute),
tagname (openpyxl.chart.data_source.StrRef attribute), 113
96 tagname (openpyxl.chart.trendline.TrendlineLabel
tagname (openpyxl.chart.data_source.StrVal attribute), 96 attribute), 113
tagname (openpyxl.chart.error_bar.ErrorBars attribute), tagname (openpyxl.chart.updown_bars.UpDownBars at-
97 tribute), 113
tagname (openpyxl.chart.label.DataLabel attribute), 98 tagname (openpyxl.chartsheet.chartsheet.Chartsheet at-
tagname (openpyxl.chart.label.DataLabelList attribute), tribute), 116
99 tagname (openpyxl.chartsheet.custom.CustomChartsheetView
tagname (openpyxl.chart.layout.Layout attribute), 99 attribute), 117
tagname (openpyxl.chart.layout.ManualLayout attribute), tagname (openpyxl.chartsheet.custom.CustomChartsheetViews
99 attribute), 117
tagname (openpyxl.chart.legend.Legend attribute), 100 tagname (openpyxl.chartsheet.properties.ChartsheetProperties
tagname (openpyxl.chart.legend.LegendEntry attribute), attribute), 117
100 tagname (openpyxl.chartsheet.protection.ChartsheetProtection
tagname (openpyxl.chart.line_chart.LineChart attribute), attribute), 118
101 tagname (openpyxl.chartsheet.publish.WebPublishItem
tagname (openpyxl.chart.line_chart.LineChart3D at- attribute), 118
tribute), 102 tagname (openpyxl.chartsheet.publish.WebPublishItems

Index 271
openpyxl Documentation, Release 2.4.0

attribute), 118 tagname (openpyxl.drawing.graphic.NonVisualPictureProperties


tagname (openpyxl.chartsheet.relation.SheetBackgroundPicture attribute), 148
attribute), 120 tagname (openpyxl.drawing.graphic.PictureFrame
tagname (openpyxl.chartsheet.views.ChartsheetView at- attribute), 149
tribute), 120 tagname (openpyxl.drawing.graphic.PictureLocking at-
tagname (openpyxl.chartsheet.views.ChartsheetViewList tribute), 150
attribute), 120 tagname (openpyxl.drawing.graphic.PictureNonVisual at-
tagname (openpyxl.comments.author.AuthorList at- tribute), 150
tribute), 120 tagname (openpyxl.drawing.line.DashStop attribute), 150
tagname (openpyxl.comments.properties.Comment at- tagname (openpyxl.drawing.line.LineEndProperties at-
tribute), 121 tribute), 150
tagname (openpyxl.comments.properties.CommentSheet tagname (openpyxl.drawing.line.LineJoinMiterProperties
attribute), 121 attribute), 151
tagname (openpyxl.descriptors.serialisable.Serialisable tagname (openpyxl.drawing.line.LineProperties at-
attribute), 127 tribute), 152
tagname (openpyxl.drawing.colors.ColorChoice at- tagname (openpyxl.drawing.shapes.Transform2D at-
tribute), 128 tribute), 158
tagname (openpyxl.drawing.colors.ColorMapping at- tagname (openpyxl.drawing.spreadsheet_drawing.AbsoluteAnchor
tribute), 129 attribute), 159
tagname (openpyxl.drawing.colors.HSLColor attribute), tagname (openpyxl.drawing.spreadsheet_drawing.AnchorMarker
130 attribute), 159
tagname (openpyxl.drawing.colors.RGBPercent at- tagname (openpyxl.drawing.spreadsheet_drawing.OneCellAnchor
tribute), 130 attribute), 160
tagname (openpyxl.drawing.colors.SystemColor at- tagname (openpyxl.drawing.spreadsheet_drawing.SpreadsheetDrawing
tribute), 132 attribute), 160
tagname (openpyxl.drawing.fill.Blip attribute), 141 tagname (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor
tagname (openpyxl.drawing.fill.BlipFillProperties at- attribute), 161
tribute), 141 tagname (openpyxl.drawing.text.CharacterProperties at-
tagname (openpyxl.drawing.fill.GradientFillProperties at- tribute), 163
tribute), 142 tagname (openpyxl.drawing.text.Font attribute), 164
tagname (openpyxl.drawing.fill.GradientStop attribute), tagname (openpyxl.drawing.text.ListStyle attribute), 165
142 tagname (openpyxl.drawing.text.Paragraph attribute), 165
tagname (openpyxl.drawing.fill.GradientStopList at- tagname (openpyxl.drawing.text.ParagraphProperties at-
tribute), 142 tribute), 167
tagname (openpyxl.drawing.fill.PatternFillProperties at- tagname (openpyxl.drawing.text.RegularTextRun at-
tribute), 143 tribute), 167
tagname (openpyxl.drawing.fill.RelativeRect attribute), tagname (openpyxl.drawing.text.RichTextProperties at-
143 tribute), 169
tagname (openpyxl.drawing.fill.StretchInfoProperties at- tagname (openpyxl.formatting.rule.ColorScale attribute),
tribute), 143 170
tagname (openpyxl.drawing.graphic.ChartRelation tagname (openpyxl.formatting.rule.DataBar attribute),
attribute), 144 171
tagname (openpyxl.drawing.graphic.GraphicData at- tagname (openpyxl.formatting.rule.FormatObject at-
tribute), 144 tribute), 171
tagname (openpyxl.drawing.graphic.GraphicFrame at- tagname (openpyxl.formatting.rule.IconSet attribute),
tribute), 145 171
tagname (openpyxl.drawing.graphic.GraphicObject at- tagname (openpyxl.formatting.rule.Rule attribute), 172
tribute), 145 tagname (openpyxl.packaging.manifest.FileExtension at-
tagname (openpyxl.drawing.graphic.NonVisualDrawingProps tribute), 173
attribute), 147 tagname (openpyxl.packaging.manifest.Manifest at-
tagname (openpyxl.drawing.graphic.NonVisualGraphicFrame tribute), 173
attribute), 148 tagname (openpyxl.packaging.manifest.Override at-
tagname (openpyxl.drawing.graphic.NonVisualGraphicFrameProperties tribute), 174
attribute), 148 tagname (openpyxl.packaging.relationship.Relationship

272 Index
openpyxl Documentation, Release 2.4.0

attribute), 174 attribute), 206


tagname (openpyxl.packaging.relationship.RelationshipList tagname (openpyxl.worksheet.properties.WorksheetProperties
attribute), 174 attribute), 206
tagname (openpyxl.styles.alignment.Alignment at- tagname (openpyxl.worksheet.protection.SheetProtection
tribute), 177 attribute), 208
tagname (openpyxl.styles.borders.Border attribute), 178 tagname (openpyxl.worksheet.views.SheetView at-
tagname (openpyxl.styles.colors.Color attribute), 178 tribute), 210
tagname (openpyxl.styles.differential.DifferentialStyle tailEnd (openpyxl.drawing.line.LineProperties attribute),
attribute), 180 152
tagname (openpyxl.styles.fills.Fill attribute), 180 Target (openpyxl.packaging.relationship.Relationship at-
tagname (openpyxl.styles.fills.GradientFill attribute), 180 tribute), 174
tagname (openpyxl.styles.fills.PatternFill attribute), 181 Target (openpyxl.workbook.names.external.ExternalBook
tagname (openpyxl.styles.fonts.Font attribute), 182 attribute), 188
tagname (openpyxl.styles.named_styles.NamedCellStyle target (openpyxl.worksheet.hyperlink.Hyperlink at-
attribute), 182 tribute), 202
tagname (openpyxl.styles.named_styles.NamedCellStyleListTargetMode (openpyxl.packaging.relationship.Relationship
attribute), 183 attribute), 174
tagname (openpyxl.styles.protection.Protection attribute), TargetMode (openpyxl.workbook.names.external.ExternalBook
184 attribute), 188
tagname (openpyxl.workbook.properties.CalcProperties test_ctor() (openpyxl.chartsheet.tests.test_chartsheet.TestChartsheet
attribute), 190 method), 114
tagname (openpyxl.workbook.properties.FileVersion at- test_read() (openpyxl.chartsheet.tests.test_chartsheet.TestChartsheet
tribute), 190 method), 114
tagname (openpyxl.workbook.properties.WorkbookProperties test_read() (openpyxl.chartsheet.tests.test_custom.TestCustomChartsheetVie
attribute), 192 method), 114
tagname (openpyxl.worksheet.datavalidation.DataValidationtest_read() (openpyxl.chartsheet.tests.test_custom.TestCustomChartsheetVie
attribute), 194 method), 114
tagname (openpyxl.worksheet.datavalidation.DataValidationListtest_read() (openpyxl.chartsheet.tests.test_properties.TestChartsheetPr
attribute), 194 method), 114
tagname (openpyxl.worksheet.drawing.Drawing at- test_read() (openpyxl.chartsheet.tests.test_protection.TestChartsheetProtecti
tribute), 196 method), 115
tagname (openpyxl.worksheet.filters.AutoFilter at- test_read() (openpyxl.chartsheet.tests.test_publish.TestWebPublishItems
tribute), 197 method), 115
tagname (openpyxl.worksheet.filters.FilterColumn test_read() (openpyxl.chartsheet.tests.test_publish.TestWebPulishItem
attribute), 199 method), 115
tagname (openpyxl.worksheet.filters.SortCondition at- test_read() (openpyxl.chartsheet.tests.test_relation.TestDrawingHF
tribute), 200 method), 115
tagname (openpyxl.worksheet.filters.SortState attribute), test_read() (openpyxl.chartsheet.tests.test_relation.TestSheetBackgroundPic
200 method), 115
tagname (openpyxl.worksheet.hyperlink.Hyperlink at- test_read() (openpyxl.chartsheet.tests.test_views.TestChartsheetView
tribute), 202 method), 115
tagname (openpyxl.worksheet.page.PageMargins at- test_read() (openpyxl.chartsheet.tests.test_views.TestChartsheetViewList
tribute), 203 method), 115
tagname (openpyxl.worksheet.page.PrintOptions at- test_write() (openpyxl.chartsheet.tests.test_chartsheet.TestChartsheet
tribute), 203 method), 114
tagname (openpyxl.worksheet.page.PrintPageSetup at- test_write() (openpyxl.chartsheet.tests.test_custom.TestCustomChartsheetVi
tribute), 204 method), 114
tagname (openpyxl.worksheet.pagebreak.Break at- test_write() (openpyxl.chartsheet.tests.test_custom.TestCustomChartsheetVi
tribute), 205 method), 114
tagname (openpyxl.worksheet.pagebreak.PageBreak at- test_write() (openpyxl.chartsheet.tests.test_properties.TestChartsheetPr
tribute), 205 method), 114
tagname (openpyxl.worksheet.properties.Outline at- test_write() (openpyxl.chartsheet.tests.test_protection.TestChartsheetProtect
tribute), 205 method), 115
tagname (openpyxl.worksheet.properties.PageSetupProperties test_write() (openpyxl.chartsheet.tests.test_publish.TestWebPublishItems

Index 273
openpyxl Documentation, Release 2.4.0

method), 115 textVAlign (openpyxl.comments.properties.Properties at-


test_write() (openpyxl.chartsheet.tests.test_publish.TestWebPulishItemtribute), 122
method), 115 tgtFrame (openpyxl.drawing.text.Hyperlink attribute),
test_write() (openpyxl.chartsheet.tests.test_relation.TestDrawingHF 164
method), 115 theme (openpyxl.styles.colors.Color attribute), 178
test_write() (openpyxl.chartsheet.tests.test_relation.TestSheetBackgroundPicture
thickBot (openpyxl.worksheet.dimensions.RowDimension
method), 115 attribute), 196
test_write() (openpyxl.chartsheet.tests.test_views.TestChartsheetView
thickTop (openpyxl.worksheet.dimensions.RowDimension
method), 115 attribute), 196
test_write() (openpyxl.chartsheet.tests.test_views.TestChartsheetViewList
thresh (openpyxl.drawing.effect.AlphaBiLevelEffect at-
method), 115 tribute), 132
test_write_charts() (open- thresh (openpyxl.drawing.effect.BiLevelEffect attribute),
pyxl.chartsheet.tests.test_chartsheet.TestChartsheet 133
method), 114 tickLblPos (openpyxl.chart.axis.DateAxis attribute), 83
TestChartsheet (class in open- tickLblPos (openpyxl.chart.axis.NumericAxis attribute),
pyxl.chartsheet.tests.test_chartsheet), 114 85
TestChartsheetPr (class in open- tickLblPos (openpyxl.chart.axis.SeriesAxis attribute), 86
pyxl.chartsheet.tests.test_properties), 114 tickLblPos (openpyxl.chart.axis.TextAxis attribute), 87
TestChartsheetProtection (class in open- tickLblSkip (openpyxl.chart.axis.SeriesAxis attribute), 86
pyxl.chartsheet.tests.test_protection), 115 tickLblSkip (openpyxl.chart.axis.TextAxis attribute), 87
TestChartsheetView (class in open- tickMarkSkip (openpyxl.chart.axis.SeriesAxis attribute),
pyxl.chartsheet.tests.test_views), 115 86
TestChartsheetViewList (class in open- tickMarkSkip (openpyxl.chart.axis.TextAxis attribute),
pyxl.chartsheet.tests.test_views), 115 87
TestCustomChartsheetView (class in open- tile (openpyxl.drawing.fill.BlipFillProperties attribute),
pyxl.chartsheet.tests.test_custom), 114 141
TestCustomChartsheetViews (class in open- TileInfoProperties (class in openpyxl.drawing.fill), 143
pyxl.chartsheet.tests.test_custom), 114 tileRect (openpyxl.drawing.fill.GradientFillProperties at-
TestDrawingHF (class in open- tribute), 142
pyxl.chartsheet.tests.test_relation), 115 time_to_days() (in module openpyxl.utils.datetime), 186
TestSheetBackgroundPicture (class in open- timedelta_to_days() (in module openpyxl.utils.datetime),
pyxl.chartsheet.tests.test_relation), 115 186
TestWebPublishItems (class in open- timePeriod (openpyxl.formatting.rule.Rule attribute), 172
pyxl.chartsheet.tests.test_publish), 115 tIns (openpyxl.drawing.text.RichTextProperties at-
TestWebPulishItem (class in open- tribute), 169
pyxl.chartsheet.tests.test_publish), 115 tint (openpyxl.drawing.colors.SystemColor attribute),
Text (class in openpyxl.cell.text), 81 132
Text (class in openpyxl.chart.text), 112 tint (openpyxl.drawing.fill.Blip attribute), 141
text (openpyxl.comments.comments.Comment attribute), tint (openpyxl.styles.colors.Color attribute), 178
121 TintEffect (class in openpyxl.drawing.effect), 139
text (openpyxl.comments.properties.Comment attribute), Title (class in openpyxl.chart.title), 112
121 title (openpyxl.chart.axis.DateAxis attribute), 83
text (openpyxl.formatting.rule.Rule attribute), 172 title (openpyxl.chart.axis.NumericAxis attribute), 85
text (openpyxl.worksheet.header_footer.HeaderFooterItem title (openpyxl.chart.axis.SeriesAxis attribute), 86
attribute), 202 title (openpyxl.chart.axis.TextAxis attribute), 87
text_color (openpyxl.drawing.shape.Shape attribute), 153 title (openpyxl.chart.chartspace.ChartContainer at-
TextAxis (class in openpyxl.chart.axis), 86 tribute), 90
TextField (class in openpyxl.drawing.text), 169 title (openpyxl.chartsheet.publish.WebPublishItem
textHAlign (openpyxl.comments.properties.Properties at- attribute), 118
tribute), 122 title (openpyxl.drawing.graphic.NonVisualDrawingProps
TextNormalAutofit (class in openpyxl.drawing.text), 170 attribute), 147
TextPoint (class in openpyxl.descriptors.excel), 125 title_maker() (in module openpyxl.chart.title), 112
textRotation (openpyxl.styles.alignment.Alignment at- TitleDescriptor (class in openpyxl.chart.title), 112
tribute), 177 to (openpyxl.drawing.spreadsheet_drawing.TwoCellAnchor

274 Index
openpyxl Documentation, Release 2.4.0

attribute), 161 attribute), 206


to_excel() (in module openpyxl.utils.datetime), 186 Trendline (class in openpyxl.chart.trendline), 112
to_tree() (openpyxl.chart.chartspace.PlotArea method), trendline (openpyxl.chart.series.Series attribute), 107
94 trendline (openpyxl.chart.series.XYSeries attribute), 109
to_tree() (openpyxl.chart.series.Series method), 107 TrendlineLabel (class in openpyxl.chart.trendline), 113
to_tree() (openpyxl.chartsheet.chartsheet.Chartsheet trendlineLbl (openpyxl.chart.trendline.Trendline at-
method), 116 tribute), 113
to_tree() (openpyxl.comments.properties.CommentSheet trendlineType (openpyxl.chart.trendline.Trendline at-
method), 121 tribute), 113
to_tree() (openpyxl.descriptors.nested.EmptyTag Tuple (class in openpyxl.descriptors.base), 124
method), 126 TwoCellAnchor (class in open-
to_tree() (openpyxl.descriptors.nested.Nested method), pyxl.drawing.spreadsheet_drawing), 160
126 twoCellAnchor (openpyxl.drawing.spreadsheet_drawing.SpreadsheetDrawin
to_tree() (openpyxl.descriptors.nested.NestedText attribute), 160
method), 126 tx (openpyxl.chart.axis.DisplayUnitsLabel attribute), 84
to_tree() (openpyxl.descriptors.sequence.NestedSequence tx (openpyxl.chart.series.Series attribute), 107
method), 127 tx (openpyxl.chart.series.XYSeries attribute), 109
to_tree() (openpyxl.descriptors.sequence.Sequence tx (openpyxl.chart.title.Title attribute), 112
method), 127 tx (openpyxl.chart.trendline.TrendlineLabel attribute),
to_tree() (openpyxl.descriptors.sequence.ValueSequence 113
method), 127 tx (openpyxl.drawing.fill.TileInfoProperties attribute),
to_tree() (openpyxl.descriptors.serialisable.Serialisable 143
method), 127 tx1 (openpyxl.drawing.colors.ColorMapping attribute),
to_tree() (openpyxl.packaging.manifest.Manifest 129
method), 173 tx2 (openpyxl.drawing.colors.ColorMapping attribute),
to_tree() (openpyxl.packaging.relationship.RelationshipList 129
method), 174 txPr (openpyxl.chart.axis.DateAxis attribute), 83
to_tree() (openpyxl.styles.fills.GradientFill method), 180 txPr (openpyxl.chart.axis.DisplayUnitsLabel attribute),
to_tree() (openpyxl.styles.fills.PatternFill method), 181 84
to_tree() (openpyxl.worksheet.page.PrintPageSetup txPr (openpyxl.chart.axis.NumericAxis attribute), 85
method), 204 txPr (openpyxl.chart.axis.SeriesAxis attribute), 86
to_tree() (openpyxl.worksheet.related.Related method), txPr (openpyxl.chart.axis.TextAxis attribute), 88
209 txPr (openpyxl.chart.chartspace.ChartSpace attribute), 91
tooltip (openpyxl.drawing.text.Hyperlink attribute), 164 txPr (openpyxl.chart.chartspace.DataTable attribute), 92
tooltip (openpyxl.worksheet.hyperlink.Hyperlink at- txPr (openpyxl.chart.chartspace.PivotFormat attribute),
tribute), 202 92
top (openpyxl.styles.borders.Border attribute), 178 txPr (openpyxl.chart.label.DataLabel attribute), 98
top (openpyxl.styles.fills.GradientFill attribute), 180 txPr (openpyxl.chart.label.DataLabelList attribute), 99
top (openpyxl.worksheet.filters.Top10 attribute), 200 txPr (openpyxl.chart.legend.Legend attribute), 100
top (openpyxl.worksheet.page.PageMargins attribute), txPr (openpyxl.chart.legend.LegendEntry attribute), 100
203 txPr (openpyxl.chart.title.Title attribute), 112
Top10 (class in openpyxl.worksheet.filters), 200 txPr (openpyxl.chart.trendline.TrendlineLabel attribute),
top10 (openpyxl.worksheet.filters.FilterColumn at- 113
tribute), 199 ty (openpyxl.drawing.fill.TileInfoProperties attribute),
topLeftCell (openpyxl.worksheet.views.Pane attribute), 143
209 type (openpyxl.cell.text.PhoneticProperties attribute), 80
topLeftCell (openpyxl.worksheet.views.SheetView type (openpyxl.drawing.effect.EffectContainer attribute),
attribute), 210 133
Transform (class in openpyxl.drawing.colors), 132 type (openpyxl.drawing.line.LineEndProperties at-
Transform2D (class in openpyxl.drawing.shapes), 158 tribute), 151
transitionEntry (openpyxl.worksheet.properties.WorksheetProperties
type (openpyxl.drawing.text.AutonumberBullet at-
attribute), 206 tribute), 161
transitionEvaluation (open- type (openpyxl.drawing.text.TextField attribute), 170
pyxl.worksheet.properties.WorksheetProperties type (openpyxl.formatting.rule.FormatObject attribute),

Index 275
openpyxl Documentation, Release 2.4.0

171 unmerge_cells() (open-


type (openpyxl.formatting.rule.Rule attribute), 173 pyxl.worksheet.worksheet.Worksheet method),
Type (openpyxl.packaging.relationship.Relationship at- 213
tribute), 174 unpack_rules() (in module open-
type (openpyxl.styles.colors.Color attribute), 178 pyxl.formatting.formatting), 170
type (openpyxl.styles.fills.GradientFill attribute), 180 up (openpyxl.drawing.shapes.Backdrop attribute), 153
Type (openpyxl.workbook.names.external.ExternalBook upBars (openpyxl.chart.updown_bars.UpDownBars at-
attribute), 188 tribute), 114
type (openpyxl.worksheet.datavalidation.DataValidation update() (openpyxl.formatting.formatting.ConditionalFormatting
attribute), 194 method), 170
type (openpyxl.worksheet.filters.DynamicFilter at- updateLinks (openpyxl.workbook.properties.WorkbookProperties
tribute), 198 attribute), 192
type (openpyxl.worksheet.header_footer.HeaderFooterItem UpDownBars (class in openpyxl.chart.updown_bars), 113
attribute), 202 upDownBars (openpyxl.chart.line_chart.LineChart
TYPE_BOOL (openpyxl.cell.cell.Cell attribute), 77 attribute), 101
TYPE_ERROR (openpyxl.cell.cell.Cell attribute), 77 upDownBars (openpyxl.chart.line_chart.LineChart3D at-
TYPE_FORMULA (openpyxl.cell.cell.Cell attribute), 77 tribute), 102
TYPE_FORMULA_CACHE_STRING (open- upDownBars (openpyxl.chart.stock_chart.StockChart at-
pyxl.cell.cell.Cell attribute), 77 tribute), 110
TYPE_INLINE (openpyxl.cell.cell.Cell attribute), 77 upright (openpyxl.drawing.text.RichTextProperties
TYPE_NULL (openpyxl.cell.cell.Cell attribute), 77 attribute), 169
TYPE_NUMERIC (openpyxl.cell.cell.Cell attribute), 77 uri (openpyxl.descriptors.excel.Extension attribute), 125
TYPE_STRING (openpyxl.cell.cell.Cell attribute), 77 uri (openpyxl.drawing.graphic.GraphicData attribute),
Typed (class in openpyxl.descriptors.base), 125 144
typeface (openpyxl.drawing.text.Font attribute), 164 useA (openpyxl.drawing.effect.ColorChangeEffect
tzname() (openpyxl.utils.datetime.GMT method), 185 attribute), 133
useFirstPageNumber (open-
U pyxl.worksheet.page.PrintPageSetup attribute),
u (openpyxl.cell.text.InlineFont attribute), 80 204
u (openpyxl.drawing.text.CharacterProperties attribute), usePrinterDefaults (open-
163 pyxl.worksheet.page.PrintPageSetup attribute),
u (openpyxl.styles.fonts.Font attribute), 182 204
uFill (openpyxl.drawing.text.CharacterProperties at- userInterface (openpyxl.chart.chartspace.Protection at-
tribute), 163 tribute), 95
uFillTx (openpyxl.drawing.text.CharacterProperties at- userShapes (openpyxl.chart.chartspace.ChartSpace
tribute), 163 attribute), 91
uiObject (openpyxl.comments.properties.Properties at- utcoffset() (openpyxl.utils.datetime.GMT method), 185
tribute), 122
uLn (openpyxl.drawing.text.CharacterProperties at- V
tribute), 163 v (openpyxl.chart.data_source.NumVal attribute), 96
uLnTx (openpyxl.drawing.text.CharacterProperties at- v (openpyxl.chart.data_source.StrVal attribute), 96
tribute), 163 v (openpyxl.chart.series.SeriesLabel attribute), 108
UNDERLINE_DOUBLE (openpyxl.styles.fonts.Font at- val (openpyxl.chart.error_bar.ErrorBars attribute), 97
tribute), 181 val (openpyxl.chart.series.Series attribute), 108
UNDERLINE_DOUBLE_ACCOUNTING (open- val (openpyxl.drawing.colors.SystemColor attribute), 132
pyxl.styles.fonts.Font attribute), 181 val (openpyxl.formatting.rule.FormatObject attribute),
UNDERLINE_SINGLE (openpyxl.styles.fonts.Font at- 171
tribute), 181 val (openpyxl.worksheet.filters.CustomFilter attribute),
UNDERLINE_SINGLE_ACCOUNTING (open- 197
pyxl.styles.fonts.Font attribute), 181 val (openpyxl.worksheet.filters.DynamicFilter attribute),
unique (openpyxl.descriptors.sequence.Sequence at- 198
tribute), 127 val (openpyxl.worksheet.filters.Top10 attribute), 200
UniversalMeasure (class in openpyxl.descriptors.excel), valAx (openpyxl.chart.chartspace.PlotArea attribute), 94
125 VALID_TYPES (openpyxl.cell.cell.Cell attribute), 77

276 Index
openpyxl Documentation, Release 2.4.0

valIso (openpyxl.worksheet.filters.DynamicFilter at- verticalCentered() (open-


tribute), 198 pyxl.worksheet.page.PrintPageSetup method),
value (openpyxl.cell.cell.Cell attribute), 78 204
value (openpyxl.cell.interface.AbstractCell attribute), 79 verticalDpi (openpyxl.worksheet.page.PrintPageSetup at-
value (openpyxl.cell.read_only.ReadOnlyCell attribute), tribute), 204
79 vertOverflow (openpyxl.drawing.text.RichTextProperties
value (openpyxl.styles.colors.Color attribute), 178 attribute), 169
value (openpyxl.workbook.names.named_range.NamedRange view (openpyxl.worksheet.views.SheetView attribute),
attribute), 189 210
value (openpyxl.workbook.names.named_range.NamedValue view3D (openpyxl.chart.bar_chart.BarChart3D attribute),
attribute), 189 89
VALUE_TAG (openpyxl.reader.worksheet.WorkSheetParserview3D (openpyxl.chart.chartspace.ChartContainer at-
attribute), 175 tribute), 90
ValueDescriptor (class in openpyxl.formatting.rule), 173 visible (openpyxl.worksheet.dimensions.Dimension at-
ValueSequence (class in openpyxl.descriptors.sequence), tribute), 195
127
varyColors (openpyxl.chart.area_chart.AreaChart at- W
tribute), 81 w (openpyxl.chart.layout.ManualLayout attribute), 99
varyColors (openpyxl.chart.area_chart.AreaChart3D at- w (openpyxl.drawing.line.LineEndProperties attribute),
tribute), 82 151
varyColors (openpyxl.chart.bar_chart.BarChart attribute), w (openpyxl.drawing.line.LineProperties attribute), 152
88 w (openpyxl.drawing.shapes.Bevel attribute), 153
varyColors (openpyxl.chart.bar_chart.BarChart3D w (openpyxl.drawing.shapes.Path2D attribute), 155
attribute), 89 W3CDTF_to_datetime() (in module open-
varyColors (openpyxl.chart.bubble_chart.BubbleChart at- pyxl.utils.datetime), 185
tribute), 90 WebPublishItem (class in openpyxl.chartsheet.publish),
varyColors (openpyxl.chart.line_chart.LineChart at- 118
tribute), 101 webPublishItem (open-
varyColors (openpyxl.chart.line_chart.LineChart3D at- pyxl.chartsheet.publish.WebPublishItems
tribute), 102 attribute), 118
varyColors (openpyxl.chart.pie_chart.DoughnutChart at- WebPublishItem() (in module open-
tribute), 103 pyxl.chartsheet.tests.test_publish), 115
varyColors (openpyxl.chart.pie_chart.PieChart attribute), WebPublishItems (class in openpyxl.chartsheet.publish),
104 118
varyColors (openpyxl.chart.pie_chart.PieChart3D at- webPublishItems (open-
tribute), 104 pyxl.chartsheet.chartsheet.Chartsheet at-
varyColors (openpyxl.chart.pie_chart.ProjectedPieChart tribute), 116
attribute), 105 WebPublishItems() (in module open-
varyColors (openpyxl.chart.radar_chart.RadarChart at- pyxl.chartsheet.tests.test_publish), 115
tribute), 105 width (openpyxl.drawing.drawing.Drawing attribute),
varyColors (openpyxl.chart.scatter_chart.ScatterChart at- 132
tribute), 106 width (openpyxl.worksheet.dimensions.ColumnDimension
vba_code (openpyxl.worksheet.worksheet.Worksheet at- attribute), 195
tribute), 213 windowProtection (open-
Vector3D (class in openpyxl.drawing.shapes), 158 pyxl.worksheet.views.SheetView attribute),
vert (openpyxl.drawing.text.RichTextProperties at- 210
tribute), 169 wireframe (openpyxl.chart.surface_chart.SurfaceChart at-
vertAlign (openpyxl.cell.text.InlineFont attribute), 80 tribute), 111
vertAlign (openpyxl.styles.fonts.Font attribute), 182 wireframe (openpyxl.chart.surface_chart.SurfaceChart3D
vertical (openpyxl.styles.alignment.Alignment attribute), attribute), 111
177 wMode (openpyxl.chart.layout.ManualLayout attribute),
vertical (openpyxl.styles.borders.Border attribute), 178 99
verticalCentered (openpyxl.worksheet.page.PrintOptions Workbook (class in openpyxl.workbook.workbook), 192
attribute), 203 WorkbookAlreadySaved, 186

Index 277
openpyxl Documentation, Release 2.4.0

WorkbookProperties (class in open- pyxl.writer.workbook), 215


pyxl.workbook.properties), 190 write_rels() (in module openpyxl.writer.relations), 214
workbookViewId (open- write_root_rels() (in module openpyxl.writer.workbook),
pyxl.chartsheet.views.ChartsheetView at- 215
tribute), 120 write_rows() (in module open-
workbookViewId (openpyxl.worksheet.views.SheetView pyxl.writer.etree_worksheet), 214
attribute), 210 write_rows() (in module open-
Worksheet (class in openpyxl.worksheet.worksheet), 211 pyxl.writer.lxml_worksheet), 214
WorkSheetParser (class in openpyxl.reader.worksheet), write_string_table() (in module openpyxl.writer.strings),
175 214
WorksheetProperties (class in open- write_theme() (in module openpyxl.writer.theme), 215
pyxl.worksheet.properties), 206 write_workbook() (in module open-
worksheets (openpyxl.workbook.workbook.Workbook pyxl.writer.workbook), 215
attribute), 193 write_workbook_rels() (in module open-
wrap (openpyxl.drawing.text.RichTextProperties at- pyxl.writer.workbook), 215
tribute), 169 write_worksheet() (in module open-
wrapText (openpyxl.styles.alignment.Alignment at- pyxl.writer.worksheet), 215
tribute), 177 WriteOnlyCell() (in module openpyxl.writer.write_only),
write() (openpyxl.drawing.shape.ShapeWriter method), 215
153 WriteOnlyWorksheet (class in open-
write_cell() (in module open- pyxl.writer.write_only), 215
pyxl.writer.etree_worksheet), 214 writer (openpyxl.writer.write_only.WriteOnlyWorksheet
write_cell() (in module openpyxl.writer.lxml_worksheet), attribute), 216
214
write_cols() (in module openpyxl.writer.worksheet), 215 X
write_comments() (open- x (openpyxl.chart.layout.ManualLayout attribute), 99
pyxl.comments.writer.CommentWriter x (openpyxl.drawing.shapes.AdjPoint2D attribute), 153
method), 123 x (openpyxl.drawing.shapes.Point2D attribute), 155
write_comments_vml() (open- x (openpyxl.drawing.shapes.Point3D attribute), 156
pyxl.comments.writer.CommentWriter x_axis (openpyxl.chart.area_chart.AreaChart attribute),
method), 123 82
write_conditional_formatting() (in module open- x_axis (openpyxl.chart.area_chart.AreaChart3D at-
pyxl.writer.worksheet), 215 tribute), 82
write_content_types() (in module open- x_axis (openpyxl.chart.bar_chart.BarChart attribute), 88
pyxl.packaging.manifest), 174 x_axis (openpyxl.chart.bar_chart.BarChart3D attribute),
write_data() (openpyxl.writer.excel.ExcelWriter method), 89
214 x_axis (openpyxl.chart.bubble_chart.BubbleChart at-
write_drawing() (in module openpyxl.writer.worksheet), tribute), 90
215 x_axis (openpyxl.chart.line_chart.LineChart attribute),
write_external_book_rel() (in module open- 101
pyxl.workbook.names.external), 188 x_axis (openpyxl.chart.line_chart.LineChart3D attribute),
write_external_link() (in module open- 102
pyxl.workbook.names.external), 188 x_axis (openpyxl.chart.radar_chart.RadarChart attribute),
write_format() (in module openpyxl.writer.worksheet), 105
215 x_axis (openpyxl.chart.scatter_chart.ScatterChart at-
write_header_footer() (in module open- tribute), 106
pyxl.writer.worksheet), 215 x_axis (openpyxl.chart.stock_chart.StockChart attribute),
write_hyperlinks() (in module open- 110
pyxl.writer.worksheet), 215 x_axis (openpyxl.chart.surface_chart.SurfaceChart3D at-
write_mergecells() (in module open- tribute), 111
pyxl.writer.worksheet), 215 xfId (openpyxl.styles.named_styles.NamedCellStyle at-
write_only (openpyxl.workbook.workbook.Workbook at- tribute), 182
tribute), 193 xfrm (openpyxl.chart.shapes.GraphicalProperties at-
write_properties_app() (in module open- tribute), 110

278 Index
openpyxl Documentation, Release 2.4.0

xfrm (openpyxl.drawing.graphic.GraphicFrame at- z_axis (openpyxl.chart.area_chart.AreaChart3D at-


tribute), 145 tribute), 82
xfrm (openpyxl.drawing.graphic.GroupShapeProperties z_axis (openpyxl.chart.bar_chart.BarChart3D attribute),
attribute), 146 89
xml_source (openpyxl.worksheet.read_only.ReadOnlyWorksheet z_axis (openpyxl.chart.line_chart.LineChart3D attribute),
attribute), 208 102
xMode (openpyxl.chart.layout.ManualLayout attribute), z_axis (openpyxl.chart.surface_chart.SurfaceChart3D at-
100 tribute), 111
xSplit (openpyxl.worksheet.views.Pane attribute), 209 zoom (openpyxl.drawing.shapes.Camera attribute), 154
xVal (openpyxl.chart.series.Series attribute), 108 zoomScale (openpyxl.chartsheet.views.ChartsheetView
xVal (openpyxl.chart.series.XYSeries attribute), 109 attribute), 120
xWindow (openpyxl.worksheet.datavalidation.DataValidationList
zoomScale (openpyxl.worksheet.views.SheetView
attribute), 194 attribute), 210
XYSeries (class in openpyxl.chart.series), 108 zoomScaleNormal (open-
pyxl.worksheet.views.SheetView attribute),
Y 210
y (openpyxl.chart.layout.ManualLayout attribute), 100 zoomScalePageLayoutView (open-
y (openpyxl.drawing.shapes.AdjPoint2D attribute), 153 pyxl.worksheet.views.SheetView attribute),
y (openpyxl.drawing.shapes.Point2D attribute), 155 210
y (openpyxl.drawing.shapes.Point3D attribute), 156 zoomScaleSheetLayoutView (open-
y_axis (openpyxl.chart.area_chart.AreaChart attribute), pyxl.worksheet.views.SheetView attribute),
82 210
y_axis (openpyxl.chart.area_chart.AreaChart3D at- zoomToFit (openpyxl.chartsheet.custom.CustomChartsheetView
tribute), 82 attribute), 117
y_axis (openpyxl.chart.bar_chart.BarChart attribute), 88 zoomToFit (openpyxl.chartsheet.views.ChartsheetView
y_axis (openpyxl.chart.bar_chart.BarChart3D attribute), attribute), 120
89
y_axis (openpyxl.chart.bubble_chart.BubbleChart at-
tribute), 90
y_axis (openpyxl.chart.line_chart.LineChart attribute),
101
y_axis (openpyxl.chart.line_chart.LineChart3D attribute),
102
y_axis (openpyxl.chart.radar_chart.RadarChart attribute),
105
y_axis (openpyxl.chart.scatter_chart.ScatterChart at-
tribute), 106
y_axis (openpyxl.chart.stock_chart.StockChart attribute),
110
y_axis (openpyxl.chart.surface_chart.SurfaceChart3D at-
tribute), 111
year (openpyxl.worksheet.filters.DateGroupItem at-
tribute), 198
yMode (openpyxl.chart.layout.ManualLayout attribute),
100
ySplit (openpyxl.worksheet.views.Pane attribute), 209
yVal (openpyxl.chart.series.Series attribute), 108
yVal (openpyxl.chart.series.XYSeries attribute), 109
yWindow (openpyxl.worksheet.datavalidation.DataValidationList
attribute), 194

Z
z (openpyxl.drawing.shapes.Point3D attribute), 156
z (openpyxl.drawing.shapes.Shape3D attribute), 157

Index 279

You might also like