pylightxl is a lightweight, zero-dependency Python library designed for reading and writing Microsoft Excel files (.xlsx, .xlsm) and CSV files. It supports Python 2.7.18 and 3+, focusing on basic cell data manipulation without supporting complex features like formatting, graphs, or macros. The library is actively maintained, with its current version being 1.61, and releases occur regularly to address bugs and add features.
pip install pylightxlVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a simple Excel file, write data including a formula, and then read data back from it using cell addresses, indices, and row iteration. It also shows how to access cell formulas.
Update your code to use `output='f'` for formulas, `output='v'` for values, or `output='c'` for comments instead of the `formula` boolean argument.
Be aware of this limitation and either ensure existing files do not contain complex features you wish to preserve, or back up files before writing.
Convert `.xls` files to a supported format like `.xlsx` or `.xlsm` before attempting to read them with pylightxl.
Inform users that they need to open and save the Excel file to see calculated results for formulas. If immediate calculation is needed, consider pre-calculating values in Python or using a library that supports formula evaluation.
Double-check the exact spelling and case of the worksheet name. You can list available sheets using `db.ws_names`. If the file is an `.xls` file, convert it to `.xlsx` or `.xlsm` format first.
Ensure that `xl.readxl()` successfully returns a `pylightxl.Database` object by assigning its result to a variable (e.g., `db = xl.readxl(fn='your_file.xlsx')`) and verifying the file exists and is valid. The `fn` argument should be the file path string or a `Pathlib.Path` object.
Update pylightxl to version 1.57 or newer. This issue was specifically addressed to improve support for non-standard sheet IDs. If the issue persists with the latest version, the Excel file might be corrupt or severely malformed.
No dependency data recorded yet.