Our take
- Activity
- 31
- Community
- 64
- Issues
- 21
- Pull requests
- 44
+0 stars in the last 16 days
Overview
xlrd reads data and formatting information from Excel files in the historical .xls format. It gives Python scripts and applications a way to inspect worksheets, their dimensions, and cell values without manually opening spreadsheets.
Use it when your input files are .xls and you need read access to their tabular contents. It no longer supports newer Excel formats, so check the project documentation for format details before choosing it.
Key Features
- Opens
.xlsworkbooks from Python. - Lists worksheet names and reports the number of sheets.
- Reads worksheets by index or name.
- Provides worksheet row and column counts.
- Retrieves individual cell values and rows.
- Extracts results of formula calculations, but not the formulas themselves.
- Reads cell formatting information.
- Includes a command-line script for displaying selected rows from
.xlsfiles.
Use Cases
- A data analyst can inspect legacy
.xlsspreadsheets as part of a Python data-processing workflow. - A developer can build a utility that extracts cell values from older Excel files.
- A team maintaining a system with archived
.xlsexports can read worksheet contents without converting each file by hand. - A user can quickly check worksheet names, dimensions, and sample rows from the command line.
Getting Started
Install the package:
pip install xlrd
See the README for usage examples and command-line details.
Considerations
- The library reads
.xlsfiles only. It does not read.xlsxfiles. - Password-protected files are not supported.
- Charts, macros, pictures, embedded objects, VBA modules, comments, hyperlinks, filters, pivot tables, conditional formatting, and data validation are not supported. Some are ignored when reading.
- Formula text is not available, although calculated results are extracted.
Found this useful?
Share it with someone who would like xlrd.