Registry / serialization / pyxlsx

pyxlsx

JSON →
library1.1.3pypypi✓ verified 84d ago

Pyxlsx is a fast and memory-efficient Python library designed for reading data from XLSX (Excel) files. It focuses on parsing core data, shared strings, and basic styling, making it suitable for high-performance data extraction. The current stable version is 1.1.3, and releases are typically made for bug fixes and minor improvements as needed.

pip install pyxlsx
INSTALL
IMPORT
SIG · PYXLSX
P
pyxlsx
serializationpythonv1.1.3
Install
5.3s avg
Import
—
Disk
108MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.1.3 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 106.9MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 5.3s · import 0.000s · 103MB
108MB installed
● package 108MB
Code
Verified usage

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

ExcelReader
✓ from pyxlsx import ExcelReader
✗ from pyxlsx import Reader
Workbook
✓ from pyxlsx import Workbook
open_xlsx
✓ from pyxlsx import open_xlsx

This quickstart demonstrates how to create a simple XLSX file using `openpyxl` and then read its contents using `pyxlsx`. It shows basic row iteration and includes cleanup.

import openpyxl import os from pyxlsx import Reader # Create a dummy XLSX file for demonstration file_path = "example.xlsx" workbook = openpyxl.Workbook() sheet = workbook.active sheet['A1'] = "Name" sheet['B1'] = "Age" sheet['A2'] = "Alice" sheet['B2'] = 30 sheet['A3'] = "Bob" sheet['B3'] = 24 workbook.save(file_path) print(f"Created dummy file: {file_path}") # Use pyxlsx to read the file try: reader = Reader(file_path) # pyxlsx iterators are one-pass; convert to list if you need to iterate multiple times rows_data = list(reader.rows()) if rows_data: print("Header row:", rows_data[0]) print("Data rows:") for row in rows_data[1:]: print(row) else: print("No data found in the file.") except FileNotFoundError: print(f"Error: The file {file_path} was not found. Please ensure it exists.") except Exception as e: print(f"An unexpected error occurred: {e}") finally: # Clean up the dummy file if os.path.exists(file_path): os.remove(file_path) print(f"Cleaned up dummy file: {file_path}")
Debug
Known issues
gotchaPyxlsx is a reader-only library. It does not support writing, modifying, or creating XLSX files. Features like macros, charts, and complex formulas are also not parsed.
fix
For writing or full manipulation, consider libraries like `openpyxl` or `xlsxwriter`.
affects: All versions
gotchaThe `lxml` dependency can sometimes be challenging to install, especially on systems without pre-compiled wheels or proper C compiler setup. It's crucial for `pyxlsx`'s performance.
fix
Ensure `lxml` is installed successfully. On some systems, you might need to install development headers (e.g., `sudo apt-get install libxml2-dev libxslt1-dev` on Debian/Ubuntu, or `brew install libxml2 libxslt` on macOS) before `pip install lxml`.
affects: All versions
gotchaPyxlsx provides basic parsing of cell values. While it handles basic number and date formatting, complex date/time formats, custom number formats, or cells with errors might be returned as their raw underlying value or require additional post-processing.
fix
Inspect output for specific cell types. For dates, consider using `datetime.datetime.fromtimestamp` or similar after parsing if the raw numeric value is returned.
affects: All versions
Upgrade
Version history
1.1.3latest on PyPI · released Jul 21, 2020
Audit
Dependencies
lxmlrequiredRequired for efficient parsing of XML components within XLSX files. This is a core dependency.
Agent activity
12 hits · last 30 days
node
12
Resources
pyxlsx — pip install pyxlsx · libregistry