Skip to content
excelrd is a modified version of xlrd to work for the latest Python versions.
Python Other
  1. Python 99.9%
  2. Other 0.1%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


PyPI package version Supported Python versions Supported Python implementations Linux/macOS CI status Test coverage


excelrd is a modified version of xlrd to work for the latest Python versions. xlrd will not work at Python 3.9 or newer versions.

Purpose: Provide a library for developers to use to extract data from Microsoft Excel (tm) spreadsheet files. It is not an end-user tool.

Author: John Machin

Licence: BSD-style (see

Versions of Python supported: 3.5+.

Outside scope: excelrd will safely and reliably ignore any of these if present in the file:

  • Charts, Macros, Pictures, any other embedded object. WARNING: currently this includes embedded worksheets.
  • VBA modules
  • Formulas (results of formula calculations are extracted, of course).
  • Comments
  • Hyperlinks
  • Autofilters, advanced filters, pivot tables, conditional formatting, data validation
  • Handling password-protected (encrypted) files.

Quick start

Print all of the cell values in a specific sheet:

Sample Code:
import excelrd

def main():
    book = excelrd.open_workbook("namesdemo.xls")

    print("The number of worksheets is {}".format(book.nsheets))
    print("Worksheet name(s): {}".format(", ".join(book.sheet_names())))

    sh = book.sheet_by_index(2)
    print("{}: rows={}, cols={}".format(, sh.nrows, sh.ncols))

    for row_idx in range(sh.nrows):
        for col_idx in range(sh.ncols):
            cell = sh.cell(row_idx, col_idx)

            if not cell.value:

            print("row={}, col={}, value={}".format(row_idx, col_idx, cell.value))

Transition from xlrd to excelrd

Just replace the import xlrd:

import excelrd as xlrd

Another quick start

This will show the first, second and last rows of each sheet in each file:

python PYDIR/scripts/ 3rows *blah*.xls


  • This package started life as a translation from C into Python of parts of a utility called "xlreader" developed by David Giffin. "This product includes software developed by David Giffin"
  • has truly excellent documentation of the Microsoft Excel file formats and Compound Document file format, authored by Daniel Rentz. See
  • U+5F20 U+654F: over a decade of inspiration, support, and interesting decoding opportunities.
  • Ksenia Marasanova: sample Macintosh and non-Latin1 files, alpha testing
  • Backporting to Python 2.1 was partially funded by Journyx - provider of timesheet and project accounting solutions (
  • Provision of formatting information in version 0.6.1 was funded by Simplistix Ltd (
You can’t perform that action at this time.