{"id":2687,"library":"pyexcel","title":"PyExcel","description":"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.","status":"active","version":"0.7.4","language":"python","source_language":"en","source_url":"https://github.com/pyexcel/pyexcel","tags":["excel","spreadsheet","data manipulation","io","csv","xlsx","xls","ods"],"install":[{"cmd":"pip install pyexcel","lang":"bash","label":"Install core library"},{"cmd":"pip install pyexcel-xls pyexcel-xlsx pyexcel-ods3","lang":"bash","label":"Install common format plugins"}],"dependencies":[{"reason":"Core I/O handling, implicitly required by pyexcel's plugin architecture.","package":"pyexcel-io","optional":false},{"reason":"Adds support for legacy .xls files (requires xlrd, xlwt).","package":"pyexcel-xls","optional":true},{"reason":"Adds support for modern .xlsx files (requires openpyxl).","package":"pyexcel-xlsx","optional":true},{"reason":"Adds support for .ods files (requires odfpy).","package":"pyexcel-ods3","optional":true}],"imports":[{"note":"Explicit format extension imports were deprecated in v0.2.2 and removed in v0.7.0. PyExcel auto-loads installed plugins.","wrong":"import pyexcel.ext.xls","symbol":"pyexcel","correct":"import pyexcel"}],"quickstart":{"code":"import pyexcel\nfrom collections import OrderedDict\n\n# --- Writing data to an Excel file (e.g., 'your_file.xlsx') ---\ndata = OrderedDict()\ndata.update({\"Sheet 1\": [[1, 2, 3], [4, 5, 6]]})\ndata.update({\"Sheet 2\": [['a', 'b', 'c'], ['d', 'e', 'f']]})\n\n# Ensure pyexcel-xlsx is installed: pip install pyexcel-xlsx\npyexcel.save_book_as(bookdict=data, dest_file_name=\"your_file.xlsx\")\nprint(\"Data written to your_file.xlsx\")\n\n# --- Reading data from an Excel file ---\n# Ensure pyexcel-xlsx is installed: pip install pyexcel-xlsx\nsheet = pyexcel.get_sheet(file_name=\"your_file.xlsx\")\nprint(f\"Content of Sheet 1 (as array): {sheet.array}\")\n\n# You can also get the whole book as a dictionary of sheets\nbook_dict = pyexcel.get_book_dict(file_name=\"your_file.xlsx\")\nprint(f\"Content of the entire book: {book_dict}\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade to Python 3.6 or newer. For older Python 3 versions, ensure pyexcel-io and its plugins are below v0.6.0.","message":"Python 2 compatibility was permanently removed in v0.6.3.","severity":"breaking","affected_versions":">=0.6.3"},{"fix":"Remove all `import pyexcel.ext.*` statements. Simply ensure the relevant `pyexcel-xxx` plugin library is installed (e.g., `pip install pyexcel-xlsx`).","message":"Explicit imports like `import pyexcel.ext.*` were removed. PyExcel now auto-loads installed plugins.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Be aware that only raw data is preserved. If styling or advanced Excel features are critical, PyExcel is not the right tool.","message":"PyExcel explicitly does NOT support fonts, styles, formulas, or charts. Saving an Excel file will strip these elements.","severity":"gotcha","affected_versions":"All versions"},{"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).","message":"Core `pyexcel` only handles CSV and TSV natively. Support for other formats (XLS, XLSX, ODS, etc.) requires installing additional `pyexcel-xxx` plugin libraries.","severity":"gotcha","affected_versions":"All versions"},{"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')`.","message":"If 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'activ':60 'api':11 'array':43 'chart':56 'color':54 'convers':37 'csv':24,71 'data':17,33,40,68 'dictionari':45 'easi':36 'enabl':35 'excel':20,39,66 'featur':51 'focus':30 'font':53 'format':21 'frequent':63 'io':70 'librari':6,58 'like':52 'maintain':61 'manipul':14,69 'minor':64 'od':28,74 'process':34 'provid':8 'pure':31 'pyexcel':1,2 'python':42 'read':13 'releas':65 'spreadsheet':67 'support':50 'unifi':10 'various':19 'versa':48 'vice':47 'without':49 'wrapper':5 'write':16 'xls':25,73 'xlsx':26,72","created_at":"2026-04-11T01:38:34.897847+00:00","updated_at":"2026-04-16T18:26:39.069970+00:00","problems":[{"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.","cause":"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.","error":"XLRDError: Unsupported format, or corrupt file: Expected BOF record; found 0x..."},{"fix":"Install the `pyexcel` package using pip: `pip install pyexcel`.","cause":"The core `pyexcel` library has not been installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'pyexcel'"},{"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.","cause":"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.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'your_file.xlsx'"},{"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).","cause":"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.","error":"Writing to Excel files with PyExcel not working on PyInstaller bundled exe (Windows), writes empty-corrupt files"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.7.6","cli_name":"","cli_version":null,"type":"library","homepage":"http://www.pyexcel.org","github":"https://github.com/pyexcel/pyexcel","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pyexcel/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}