excelrd is a Python library designed for developers to extract data and formatting information from Microsoft Excel spreadsheet files, supporting both the older `.xls` and newer `.xlsx` formats. It is a modified version of the `xlrd` library, specifically updated to maintain compatibility and functionality with modern Python versions (3.7+), as `xlrd` itself no longer supports `.xlsx` files in its recent versions. The library is currently at version 3.0.0 and sees releases primarily for Python compatibility and maintenance.
pip install excelrdVerified import paths — ran on the pinned version, not inferred.
The quickstart demonstrates how to open an Excel workbook, retrieve the number of sheets and their names, access a specific sheet by its index, and then iterate through its cells to print their values. This pattern is fundamental for extracting tabular data.
Upgrade your Python interpreter to version 3.7 or higher. If you must use older Python versions, consider pinning `excelrd<3.0.0` (though this is not recommended due to lack of security updates).
Migrate your codebase to Python 3. `excelrd` versions 2.0.0 and later are Python 3 only.
If you need to extract the formulas, `excelrd` is not the right tool. Consider `openpyxl` (for .xlsx) or other libraries designed for formula extraction.
Ensure that any Excel files you intend to process with `excelrd` are not password-protected. Remove password protection manually before attempting to read them programmatically.
Be aware of this limitation when expecting to preserve or extract non-data elements. If these elements are critical, an alternative library or tool might be necessary.
Run `pip install excelrd` to install the library.
Double-check the file path and name, ensuring it's absolute or correctly relative to your script's execution directory. Verify file permissions.
Verify that the file you are attempting to open is a legitimate Excel file and not, for example, a CSV file renamed to .xls, or a severely corrupted document. Try opening the file manually in Excel to confirm its integrity. If it's an `.xlsx` file and you are certain it's valid, ensure `excelrd` is updated to the latest version to handle newer `.xlsx` structures.
No dependency data recorded yet.