xlrd
A Python library for extracting data and formatting from legacy Excel .xls spreadsheet files
Repository Health
Technical Analysis
xlrd is a library for developers to extract data, formatting information, and workbook structure from Microsoft Excel’s legacy binary .xls spreadsheet format. It has been scoped down deliberately: as of its README, xlrd no longer reads the newer .xlsx format at all, pointing users toward openpyxl or other tools in the python-excel ecosystem for that. Within its narrowed scope it remains actively maintained, handling cell values, dates, number formats, and workbook/sheet structure for the older Excel binary format that many legacy enterprise systems and archives still produce.
What You Get
- A
open_workbook()entry point returning aBookobject with sheets addressable by name or index - Cell-level access to values, types, and Excel’s internal number-format/date-format information via
xlrd.sheet - Correct conversion of Excel’s serial date values to Python
datetimeobjects viaxlrd.xldate - Low-level BIFF and OLE2 compound-document parsing (
xlrd.biffh,xlrd.compdoc) for developers needing deeper access to .xls internals - A bundled
runxlrd.pyCLI script for quick inspection of .xls file contents from the command line
Common Use Cases
- Reading legacy .xls files produced by older enterprise systems, exports, or archives that predate the .xlsx format
- Batch-processing or migrating historical .xls spreadsheet data into a database or newer file format
- Extracting cell values and dates from .xls files as part of a data pipeline where openpyxl (which does not support .xls) isn’t applicable
- Building a lightweight CLI or script to inspect the structure of an unfamiliar .xls file without opening Excel
Under The Hood
Architecture xlrd’s core is a two-layer parser: xlrd.compdoc decodes the OLE2/Compound Document File Binary Format container that wraps an .xls file’s internal streams, and xlrd.biffh/xlrd.book/xlrd.sheet decode the BIFF (Binary Interchange File Format) record stream inside that container into a Book object holding one or more Sheet objects, each exposing rows/columns of Cell values. xlrd.formatting reconstructs Excel’s number-format definitions so callers can tell a date cell from a currency cell, and xlrd.xldate converts Excel’s numeric date serials (handling both the 1900 and 1904 epoch systems) into Python datetime values. xlrd.formula separately decodes Excel formula byte-code when present, though only computed results are exposed, not live formula re-evaluation. Tech Stack Pure Python with no runtime dependencies, packaged with a conventional setup.py/setup.cfg; xlrd/timemachine.py is a small Python 2/3 compatibility shim reflecting the library’s long history predating Python 3-only codebases. Code Quality The tests/ directory holds 14 test modules covering BIFF record parsing, date conversion edge cases, and sample .xls fixtures; CI runs via CircleCI with Codecov coverage tracking as advertised in the README badges. The codebase itself is dense, low-level byte-parsing code (book.py and sheet.py each run over 1,400-2,400 lines) reflecting the intrinsic complexity of a binary file format rather than incidental complexity. API Design The primary entry point, xlrd.open_workbook(), returns a Book whose .sheets()/.sheet_by_name() and cell-indexing methods are simple and stable, requiring little boilerplate for the common case of just reading values; the tradeoff is that the library intentionally does not attempt to support newer .xlsx files at all, so callers must branch on file format themselves if they need to support both.
Used by 11 apps in this directory
Agno
Devops · AI Development · Automation
Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.
Airbyte
Developer Tools · Data Engineering
Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.
Baserow
No Code Platforms · Databases
Open-source no-code platform to build databases, apps, automations, and AI agents — self-hosted or cloud, with full data ownership.
BotCity Framework
Automation · Developer Tools
Computer-vision powered Python framework for building RPA bots that click, type, and read any desktop, web, or terminal UI without needing an API.
Continue
Developer Tools · AI Development · AI Code Assistants
Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.
headroom
AI Development · Developer Tools
Compress everything your AI agent reads — tool outputs, logs, RAG chunks, and files — before it reaches the LLM, achieving 60–95% fewer tokens with the same answers.
MaxKB
AI Development · Knowledge Management
Build enterprise-grade AI agents with RAG, workflows & multi-modal support
Odoo
ERP · CRM · Productivity
The open source ERP platform that integrates CRM, accounting, inventory, manufacturing, and 60+ business apps into one seamlessly connected suite.
Open WebUI
AI Assistants · AI Agents
The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.