pyexcel-xls is a wrapper library designed to read, manipulate, and write data in the older Microsoft Excel XLS (Binary Interchange File Format) format. It functions primarily as a plugin for the `pyexcel` library, offering a unified API for spreadsheet data handling. The library is currently at version 0.7.1 and maintains an active, albeit sporadic, release cadence, typically tied to essential maintenance or updates of its core dependencies.
pip install pyexcel-xlsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `pyexcel` (which leverages `pyexcel-xls` automatically) to write data to an `.xls` file and then read it back. It uses `OrderedDict` for structured sheet data and then saves and loads using `pyexcel.save_as` and `pyexcel.get_book` respectively.
For `.xlsx` or `.xlsm` files, install `pyexcel-xlsx` (`pip install pyexcel-xlsx`). `pyexcel-xlsx` uses `openpyxl` which properly handles these modern formats. If you specifically need `pyexcel-xls` to read `.xlsx` (though not recommended), you would have to pin `xlrd < 2.0.0` in your environment (e.g., `pip install 'xlrd<2.0.0' pyexcel-xls`).
Ensure your project runs on Python 3.6 or a more recent version.
For datasets larger than 65,536 rows, use the `.xlsx` format, which is supported by the `pyexcel-xlsx` library.
Do not use `pyexcel-xls` if the preservation of visual formatting, styles, or formulas is a requirement. If only data extraction/insertion is needed, be aware that all such information will be lost upon saving.
Implement post-processing logic to detect and handle these specific date/time interpretations if zero values in these fields are expected in your source data.