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

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

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

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

Analyzed by OSRepos on August 31, 2026

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:

  • 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

Related repositories

Similar repositories that may be relevant next.

Mistune: A Fast and Powerful Python Markdown Parser

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.

markdownPythonparser
csvkit: Powerful Command-Line Tools for CSV Data Manipulation

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.

PythonCSVData Processing
Lektor: A Python Static Site Generator with Admin UI

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.

cmsstatic-site-generatorPython
makesite: A Simple Python Static Site/Blog Generator

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.

PythonStatic Site GeneratorBlog Generator

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️