# xlrd: A Python Library for Reading Legacy Excel .xls Files

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/python-excel-xlrd
Generated for open source discovery and AI-assisted research.

xlrd is a Python library designed for reading data and formatting information from older Microsoft Excel .xls files. It provides a robust solution for interacting with legacy spreadsheet data, offering functionalities to access worksheets, rows, and cell values. While powerful for its specific niche, users are encouraged to consider openpyxl for newer .xlsx formats.

GitHub: https://github.com/python-excel/xlrd
OSRepos URL: https://osrepos.com/repo/python-excel-xlrd

## Summary

xlrd is a Python library designed for reading data and formatting information from older Microsoft Excel .xls files. It provides a robust solution for interacting with legacy spreadsheet data, offering functionalities to access worksheets, rows, and cell values. While powerful for its specific niche, users are encouraged to consider openpyxl for newer .xlsx formats.

## Topics

- Python
- Excel
- Spreadsheet
- Data Processing
- Legacy Files
- Data Analysis
- Office Automation

## Repository Information

Last analyzed by OSRepos: Mon Aug 31 2026 01:33:49 GMT+0100 (Western European Summer Time)
Detail views: 1
GitHub clicks: 0

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction
`xlrd` is a well-established Python library dedicated to reading data and formatting information from historical Microsoft Excel `.xls` files. With over 2200 stars and 400 forks on GitHub, it has been a go-to tool for developers needing to process legacy Excel spreadsheets. It provides a straightforward API to access workbook, sheet, row, and cell data, making it easy to extract information from these older file formats.

## Installation
Getting started with `xlrd` is simple using pip:

bash
pip install xlrd


## Examples
Here's a quick example demonstrating how to open an `.xls` file and read its contents:

python
import xlrd
book = xlrd.open_workbook("myfile.xls")
print("The number of worksheets is {0}".format(book.nsheets))
print("Worksheet name(s): {0}".format(book.sheet_names()))
sh = book.sheet_by_index(0)
print("{0} {1} {2}".format(sh.name, sh.nrows, sh.ncols))
print("Cell D30 is {0}".format(sh.cell_value(rowx=29, colx=3)))
for rx in range(sh.nrows):
    print(sh.row(rx))


## Why Use xlrd?
`xlrd` is specifically designed for handling the `.xls` file format, which is crucial for projects dealing with older data archives or systems that still generate these legacy files. It efficiently extracts data, including results of formula calculations, though it does not process the formulas themselves.

**Important Considerations:**
*   `xlrd` **only supports `.xls` files**. It will not read `.xlsx` or other newer Excel formats.
*   For modern Excel files (`.xlsx`), the project explicitly recommends using alternatives like `openpyxl`.
*   Many advanced Excel features, such as charts, macros, embedded objects, VBA modules, comments, and password-protected files, are not supported and will be ignored or prevent reading.

If your workflow strictly involves legacy `.xls` files and you need a reliable Python solution for data extraction, `xlrd` remains a valuable tool.

## Links
*   **GitHub Repository:** [https://github.com/python-excel/xlrd](https://github.com/python-excel/xlrd)
*   **Documentation:** [http://xlrd.readthedocs.io/en/latest/](http://xlrd.readthedocs.io/en/latest/)
*   **PyPI:** [https://badge.fury.io/py/xlrd](https://badge.fury.io/py/xlrd)