Pyexcel-io is a Python library providing a unified API to read and write structured data from various file formats (CSV, TSV, and extensions like XLS, XLSX, ODS via plugins) and databases (SQLAlchemy, Django models). It focuses on data processing, not formatting, fonts, or charts. It is actively maintained with frequent minor releases.
pip install pyexcel-ioVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `pyexcel-io` to write tabular data to a virtual CSV file (using `StringIO`) and then read it back. The core functions `save_data` and `get_data` provide a unified interface for various data sources and formats.
Upgrade to Python 3.6 or newer, or use pyexcel-io versions lower than 0.6.0 if Python 2 or older Python 3 is necessary.
Update existing plugins or develop new ones conforming to the new plugin interface. Review PyInstaller documentation for updated packaging instructions.
If reading `csvz` or `tsvz` formats, explicitly install `chardet`: `pip install chardet`.
Upgrade to pyexcel-io v0.6.7 or newer. If upgrading is not possible, avoid dots in filenames or provide a file-like object instead.
Explicitly specify the desired plugin using the `library` parameter in `get_data` or `save_data` (e.g., `get_data(..., library='pyexcel-odsr')`), or uninstall the unwanted overlapping plugin.
Users needing to preserve such formatting or handle protected files should consider alternative libraries or pre-process/post-process files outside of pyexcel-io.
For optimal memory usage with large files, prefer CSV format or plugins explicitly designed for streaming (e.g., `pyexcel-xlsxr`).
Install the required plugin using pip. For example, to read or write XLSX files, run `pip install pyexcel-xlsx`.
Verify the file path and filename are accurate, including the correct file extension. Ensure the file exists in the specified location, or use an absolute path to the file.
Explicitly include the necessary `pyexcel` plugins in your PyInstaller command using `--hidden-import`. For example: `pyinstaller your_script.py --hidden-import pyexcel_xlsx --hidden-import pyexcel_xls`.
Ensure that the data structure passed to the writing function is a dictionary where keys are sheet names (strings) and values are the sheet's data (e.g., a list of lists). If you have a single sheet, wrap it like `{'Sheet1': your_list_of_lists}`.