Registry / data / pyexcel

pyexcel

JSON →
library0.7.6pypypi✓ verified 26d ago

PyExcel is a wrapper library that provides a unified API to read, manipulate, and write data in various Excel formats such as CSV, XLS, XLSX, and ODS. It focuses purely on data processing, enabling easy conversion of Excel data into Python arrays or dictionaries and vice versa, without supporting features like fonts, colors, or charts. The library is actively maintained, with frequent minor releases.

pip install pyexcel
INSTALL
IMPORT
SIG · PYEXCEL
P
pyexcel
datapythonv0.7.6
Install
2.4s avg
Import
238ms
Disk
82MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.6 · 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.103.910 runs
installs and imports cleanly · install 0.0s · import 0.246s · 89.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.4s · import 0.230s · 20MB
82MB installed
● package 82MB
Code
Verified usage

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

pyexcel
import pyexcel
import pyexcel.ext.xls
Explicit format extension imports were deprecated in v0.2.2 and removed in v0.7.0. PyExcel auto-loads installed plugins.

This quickstart demonstrates how to write a Python dictionary to a multi-sheet Excel file and then read it back into a sheet object and a book dictionary. It assumes the necessary format-specific plugins (like `pyexcel-xlsx`) are installed.

import pyexcel from collections import OrderedDict # --- Writing data to an Excel file (e.g., 'your_file.xlsx') --- data = OrderedDict() data.update({"Sheet 1": [[1, 2, 3], [4, 5, 6]]}) data.update({"Sheet 2": [['a', 'b', 'c'], ['d', 'e', 'f']]}) # Ensure pyexcel-xlsx is installed: pip install pyexcel-xlsx pyexcel.save_book_as(bookdict=data, dest_file_name="your_file.xlsx") print("Data written to your_file.xlsx") # --- Reading data from an Excel file --- # Ensure pyexcel-xlsx is installed: pip install pyexcel-xlsx sheet = pyexcel.get_sheet(file_name="your_file.xlsx") print(f"Content of Sheet 1 (as array): {sheet.array}") # You can also get the whole book as a dictionary of sheets book_dict = pyexcel.get_book_dict(file_name="your_file.xlsx") print(f"Content of the entire book: {book_dict}")
Debug
Known issues
breakingPython 2 compatibility was permanently removed in v0.6.3.
fix
Upgrade to Python 3.6 or newer. For older Python 3 versions, ensure pyexcel-io and its plugins are below v0.6.0.
affects: >=0.6.3
breakingExplicit imports like `import pyexcel.ext.*` were removed. PyExcel now auto-loads installed plugins.
fix
Remove all `import pyexcel.ext.*` statements. Simply ensure the relevant `pyexcel-xxx` plugin library is installed (e.g., `pip install pyexcel-xlsx`).
affects: >=0.7.0
gotchaPyExcel explicitly does NOT support fonts, styles, formulas, or charts. Saving an Excel file will strip these elements.
fix
Be aware that only raw data is preserved. If styling or advanced Excel features are critical, PyExcel is not the right tool.
affects: All versions
gotchaCore `pyexcel` only handles CSV and TSV natively. Support for other formats (XLS, XLSX, ODS, etc.) requires installing additional `pyexcel-xxx` plugin libraries.
fix
Install the specific plugin for your target format (e.g., `pip install pyexcel-xlsx` for .xlsx files, `pip install pyexcel-xls` for .xls files).
affects: All versions
gotchaIf multiple plugins are installed for the same file format (e.g., `pyexcel-ods` and `pyexcel-ods3`), you may need to explicitly specify which plugin to use.
fix
Use the `library='plugin_name'` parameter in functions like `get_array`, `save_as`, etc., e.g., `pyexcel.get_sheet(file_name='my.ods', library='pyexcel-ods3')`.
affects: All versions
Errors
Common errors & fixes
XLRDError: Unsupported format, or corrupt file: Expected BOF record; found 0x...
PyExcel relies on separate plugins for different Excel formats (e.g., `pyexcel-xls` for .xls, `pyexcel-xlsx` for .xlsx). This error often occurs when attempting to open a newer .xlsx file with only the `pyexcel-xls` plugin installed (which uses `xlrd`, a library primarily for older .xls files), or if the file is genuinely corrupted or malformed.
fix
Install the correct plugin for your file type. For .xlsx files: `pip install pyexcel-xlsx`. For older .xls files: `pip install pyexcel-xls`. Ensure the file is not corrupted and is a valid Excel format.
ModuleNotFoundError: No module named 'pyexcel'
The core `pyexcel` library has not been installed in your current Python environment.
fix
Install the `pyexcel` package using pip: `pip install pyexcel`.
FileNotFoundError: [Errno 2] No such file or directory: 'your_file.xlsx'
The Python interpreter cannot find the Excel file at the specified path. This could be due to a typo in the filename, an incorrect relative path, or the file not existing in the expected directory.
fix
Verify the file name is spelled correctly, provide the full absolute path to the file, or ensure the file is located in your script's current working directory.
Writing to Excel files with PyExcel not working on PyInstaller bundled exe (Windows), writes empty-corrupt files
When packaging a Python application with PyInstaller, `pyexcel`'s format-specific plugins (like `pyexcel-xls` or `pyexcel-xlsx`) may not be automatically detected and included, leading to failures in reading or writing Excel files in the compiled executable.
fix
Explicitly tell PyInstaller to include the necessary `pyexcel` plugins as hidden imports. For example, if you use both .xls and .xlsx: `pyinstaller --hidden-import=pyexcel_xls --hidden-import=pyexcel_xlsx your_script.py` (adjust plugins as per your needs).
Upgrade
Version history
0.7.6latest on PyPI · released Jun 29, 2026
Audit
Dependencies
pyexcel-iorequiredCore I/O handling, implicitly required by pyexcel's plugin architecture.
pyexcel-xlsoptionalAdds support for legacy .xls files (requires xlrd, xlwt).
pyexcel-xlsxoptionalAdds support for modern .xlsx files (requires openpyxl).
pyexcel-ods3optionalAdds support for .ods files (requires odfpy).
Agent activity
12 hits · last 30 days
node
10
Resources
pyexcel — pip install pyexcel · libregistry