xlrd: A Python Library for Reading Legacy Excel .xls Files
This repository profile is provided by osrepos.com, an open source repository discovery platform.

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.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
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:
pip install xlrd
Examples
Here's a quick example demonstrating how to open an .xls file and read its contents:
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:
xlrdonly supports.xlsfiles. It will not read.xlsxor other newer Excel formats.- For modern Excel files (
.xlsx), the project explicitly recommends using alternatives likeopenpyxl. - 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
- Documentation: http://xlrd.readthedocs.io/en/latest/
- PyPI: https://badge.fury.io/py/xlrd
Related repositories
Similar repositories that may be relevant next.

Mistune: A Fast and Powerful Python Markdown Parser
August 30, 2026
Mistune is a high-performance Python library designed for parsing Markdown into HTML. It offers a fast and powerful solution for developers needing to convert Markdown text, featuring extensive support for renderers and plugins to customize the parsing process. This makes it a versatile tool for various web development and content processing needs.

csvkit: Powerful Command-Line Tools for CSV Data Manipulation
August 30, 2026
csvkit is a robust suite of command-line utilities designed for efficient conversion and manipulation of CSV files. It simplifies complex data tasks, making it an indispensable tool for anyone working with tabular data. Inspired by tools like pdftk and GDAL, csvkit brings powerful data processing capabilities directly to your terminal.

Lektor: A Python Static Site Generator with Admin UI
August 30, 2026
Lektor is a static website generator written in Python, designed to build projects from static files into HTML pages. It stands out with its integrated admin UI and a minimal desktop application, simplifying content management for static sites and offering a robust solution for web development.

makesite: A Simple Python Static Site/Blog Generator
August 29, 2026
makesite is a simple, lightweight, and magic-free static site/blog generator crafted for Python developers. It empowers users to take full control of their website generation process, encouraging customization and a deep understanding of how their site is built. This project offers a quick-start kit for those who prefer to write their own generator rather than rely on complex frameworks.
Source repository
Open the original repository on GitHub.