{"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":"en","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,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}