Registry / data / pyexcel-io

pyexcel-io

JSON →
library0.6.8pypypi✓ verified 28d ago

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-io
INSTALL
IMPORT
SIG · PYEXCEL-IO
P
pyexcel-io
datapythonv0.6.8
Install
1.6s avg
Import
83ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.6.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.088s · 18.3MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.078s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_data
✓ from pyexcel_io import get_data
save_data
✓ from pyexcel_io import save_data

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.

import os from pyexcel_io import save_data, get_data from io import StringIO # --- Writing data to a virtual CSV file (StringIO) --- data_to_write = [ ["Name", "Age", "City"], ["Alice", 30, "New York"], ["Bob", 24, "London"] ] output_stream = StringIO() save_data(output_stream, data_to_write, file_type='csv') # Simulate getting content from the stream output_stream.seek(0) csv_content = output_stream.getvalue() print("Generated CSV content:\n" + csv_content) # --- Reading data from the virtual CSV file (StringIO) --- input_stream = StringIO(csv_content) # get_data returns a dictionary where keys are sheet names (or 'csv' for single file) dread_data = get_data(input_stream, file_type='csv') # Access the first (and only) sheet, usually named 'csv' if 'csv' in dread_data: print("\nRead data:") for row in dread_data['csv']: print(row) else: print("Error: Could not read data from CSV stream.") # Example with a physical file (uncomment to test locally) # file_name = "example.csv" # save_data(file_name, data_to_write) # data_from_file = get_data(file_name) # print(f"\nData from {file_name}: {data_from_file[file_name]}") # os.remove(file_name) # Clean up
Debug
Known issues
breakingPyexcel-io v0.6.0 dropped support for Python 2 and older Python 3 versions (3.3, 3.4, 3.5). Python 3.6+ is now required.
fix
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.
affects: >=0.6.0
breakingThe plugin interface was completely rewritten in v0.6.0, making plugins developed for older versions (e.g., v0.3.x) incompatible. This also impacts PyInstaller users requiring updated configurations.
fix
Update existing plugins or develop new ones conforming to the new plugin interface. Review PyInstaller documentation for updated packaging instructions.
affects: >=0.6.0
gotchaThe `chardet` library, previously an implicit dependency for `csvz` and `tsvz` readers, became optional in v0.6.7. If your application relies on these formats, you may need to install `chardet` explicitly.
fix
If reading `csvz` or `tsvz` formats, explicitly install `chardet`: `pip install chardet`.
affects: >=0.6.7
gotchaIn versions prior to 0.6.7, pathnames containing dots ('.') could cause `file_name` errors when using `get_writer`.
fix
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.
affects: <0.6.7
gotchaWhen multiple pyexcel plugins (e.g., `pyexcel-ods` and `pyexcel-odsr`) are installed that support the same file format, `pyexcel-io` might pick one unpredictably. This can lead to unexpected behavior or an error.
fix
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.
affects: All versions
gotchaPyexcel-io specifically focuses on tabular data; it does not support reading or writing fonts, colors, charts, images, or password-protected Excel files.
fix
Users needing to preserve such formatting or handle protected files should consider alternative libraries or pre-process/post-process files outside of pyexcel-io.
affects: All versions
gotchaWhile pyexcel-io supports 'streaming' for large files, many underlying plugins for formats like XLS, XLSX, and ODS (e.g., `pyexcel-xls`, `pyexcel-xlsx`, `pyexcel-ods`) still load the entire file into memory due to their zipped XML structure. Only `csv` readers, `pyexcel-xlsxr`, `pyexcel-odsr`, and `pyexcel-htmlr` truly support partial/streaming reads for memory efficiency.
fix
For optimal memory usage with large files, prefer CSV format or plugins explicitly designed for streaming (e.g., `pyexcel-xlsxr`).
affects: All versions
Errors
Common errors & fixes
pyexcel_io.exceptions.SupportingPluginAvailableButNotInstalled: Please install one of these plugins for read data in 'xlsx': pyexcel-xls,pyexcel-xlsx
Pyexcel-io itself only handles basic CSV/TSV formats; for other file types like XLS, XLSX, or ODS, it relies on external plugins (e.g., `pyexcel-xlsx`, `pyexcel-xls`, `pyexcel-ods`) which must be explicitly installed.
fix
Install the required plugin using pip. For example, to read or write XLSX files, run `pip install pyexcel-xlsx`.
FileNotFoundError: [Errno 2] No such file or directory
The file specified in the `pyexcel-io` operation (e.g., `get_data`, `save_data`) does not exist at the provided path, or the path/filename is incorrect.
fix
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.
(Often manifests as 'pyexcel_io.exceptions.SupportingPluginAvailableButNotInstalled' at runtime from a PyInstaller executable)
When packaging an application with PyInstaller, the lazy-loading nature of `pyexcel-io`'s format-specific plugins means PyInstaller might not automatically detect and include them in the bundled executable, leading to runtime errors when trying to access those formats.
fix
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`.
AttributeError: 'list' object has no attribute 'keys'
This error occurs when a function that expects a dictionary of sheet names to data (e.g., `{'Sheet1': [[1,2],[3,4]]}`) receives a plain list of lists (e.g., `[[1,2],[3,4]]`) instead, particularly when trying to save data to a multi-sheet-capable format.
fix
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}`.
Upgrade
Version history
0.6.8latest on PyPI · released Jun 28, 2026
Audit
Dependencies
chardetoptionalRequired for reading 'csvz' and 'tsvz' formats. Moved to optional since v0.6.7.
Agent activity
5 hits · last 30 days
node
4
Resources
pyexcel-io — pip install pyexcel-io · libregistry