Skip to main content

High-performance .xlsx reader/writer (C extension)

Project description

openexcel

A high-performance Python library for reading and writing .xlsx files, implemented as a C extension. Designed as a drop-in accelerator for workloads where openpyxl is too slow.

Why

openpyxl is pure Python. For large files (100k+ rows), the bottlenecks are ZIP extraction, XML parsing, and per-cell object allocation — all done in the Python interpreter. openexcel moves these to C:

  • Streaming SAX parsing via libexpat — never loads the full XML into memory
  • Flat sorted cell array — O(1) append during parse, O(1) sequential iteration
  • GIL released during read and write — other threads run freely
  • Vendored miniz — no external ZIP dependency

Typical speedups: 10–30× faster reads, 5–15× faster writes on 100k-row sheets.

Installation

pip install openexcel-c

Pre-built wheels are available for macOS (arm64, x86_64) and Linux (x86_64, aarch64) for Python 3.10–3.13.

Building from source

You need CMake ≥ 3.20, a C11 compiler, and libexpat development headers.

# macOS
brew install expat cmake

# Ubuntu/Debian
sudo apt-get install libexpat1-dev cmake

pip install openexcel-c --no-binary openexcel-c

Usage

Reading

import openexcel

wb = openexcel.load_workbook("data.xlsx")
ws = wb.active   # first sheet

# Iterate rows — returns tuples of Python values
for row in ws.iter_rows():
    print(row)   # e.g. (1, "hello", 3.14, True, datetime.date(2024, 6, 1))

# Slice a range
for row in ws.iter_rows(min_row=2, max_row=100, min_col=1, max_col=5):
    print(row)

Cell values map to Python types:

Excel type Python type
Number float
String str
Boolean bool
Date / datetime datetime.date / datetime.datetime
Empty None
Error str (e.g. "#DIV/0!")

Writing

import openexcel
import datetime

wb = openexcel.Workbook()
ws = wb.create_sheet("Sheet1")

ws.append(["Name", "Score", "Date"])
ws.append(["Alice", 98.5, datetime.date(2024, 6, 1)])
ws.append(["Bob",   72.0, datetime.date(2024, 6, 2)])

wb.save("output.xlsx")

Multiple sheets

wb = openexcel.load_workbook("multi.xlsx")

# By index
ws = wb[0]

# By name
ws = wb["Summary"]

# Iterate all sheets
for ws in wb:
    print(ws.title, ws.max_row, ws.max_column)

Context manager

with openexcel.load_workbook("data.xlsx") as wb:
    ws = wb.active
    data = [row for row in ws.iter_rows()]
# file resources released on exit

API reference

openexcel.load_workbook(path: str) -> Workbook

Open an existing .xlsx file for reading. Parses the entire file on load; subsequent access is from memory.

openexcel.Workbook()

Create a new empty workbook.

Workbook.create_sheet(name: str) -> Worksheet

Add a new sheet and return it.

Workbook.save(path: str)

Write the workbook to an .xlsx file. GIL is released during write.

Workbook.active -> Worksheet

Returns the first sheet.

Worksheet.iter_rows(min_row=None, max_row=None, min_col=None, max_col=None)

Yields one tuple per row. Indices are 1-based and inclusive, matching openpyxl's convention.

Worksheet.append(row: list | tuple)

Append a row of values. Accepts int, float, str, bool, None, datetime.date, datetime.datetime.

Worksheet.max_row -> int

Worksheet.max_column -> int

Worksheet.title -> str

Differences from openpyxl

Feature openexcel openpyxl
Read speed Fast (C, SAX) Slow (pure Python)
Write speed Fast (C, arena buffer) Slow (pure Python)
Cell objects Not exposed (values only) Full Cell with font/fill/border
Formulas Read result value only Read formula string
Styles / formatting Date detection only Full style API
Merged cells Not supported Supported
Charts / images Not supported Supported

openexcel is optimized for data workloads — reading and writing large tables of values. If you need full formatting control or chart support, use openpyxl.

License

MIT — see LICENSE.

Vendored dependencies:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openexcel_c-0.1.1.tar.gz (119.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

openexcel_c-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (72.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

openexcel_c-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (73.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

openexcel_c-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (62.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

openexcel_c-0.1.1-cp313-cp313-macosx_10_13_x86_64.whl (64.7 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

openexcel_c-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (72.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

openexcel_c-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (73.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

openexcel_c-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (62.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

openexcel_c-0.1.1-cp312-cp312-macosx_10_13_x86_64.whl (64.7 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

openexcel_c-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (72.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

openexcel_c-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (73.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

openexcel_c-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (62.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

openexcel_c-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl (64.5 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

openexcel_c-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (72.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

openexcel_c-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (73.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

openexcel_c-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (62.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

openexcel_c-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl (64.5 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

Details for the file openexcel_c-0.1.1.tar.gz.

File metadata

  • Download URL: openexcel_c-0.1.1.tar.gz
  • Upload date:
  • Size: 119.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openexcel_c-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8f6b5ccc98447e09f86b20862e9a65cff843cdb702c8f2ec13f8362fef1be767
MD5 a4baac6211ff97eaf164c3eb5d373c5f
BLAKE2b-256 8720b39d6f06a8f63771649591c4b1d5ba31fc8427bb8c58d82f31940faf6cd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1.tar.gz:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 03dcf2fba1b21cc61b924e6edf329b55fa004e769365ae5dc53b3ef1bf414115
MD5 7c5b9a9e08c0eb6592176cf830bafc43
BLAKE2b-256 75ba86c25796672c19351f542afa6e0d2aae2825cd6500e09df72ed923df5b9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c2919701017df0d93c7bb1f8967670bf4f10315f8af60a81b1baf888756eab77
MD5 eee871189e2471ed77cbc0f67d47b714
BLAKE2b-256 b8411d1b9c33ad9fc25e6f4ee3e1300e18ba39a1011861b653cdc7208a586b7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b7af7801508c6c9faaf28416c8d3e31413dcf00870ae6e295080e913ffa24ad0
MD5 46aeb8078e35f921a9ec49c03417bc11
BLAKE2b-256 bd735b569b1824e636d78c1605a179453b0851ac219c39a7a0b0cce22f6cfbb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 3fd9848981e427e15b80bb78b1440244141590362a1cc6469271d692375d2fa8
MD5 6eb437c38475f16adcdd9f926c85c9cd
BLAKE2b-256 b4f691c5930451d4dfbd286978d10e4721f1f416bf753087f958394584f83722

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp313-cp313-macosx_10_13_x86_64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a16593658868b7d67a7d87d0dc39cbf0e58331513cffdcf8d11327b36e9f990a
MD5 50bd24a630f220e1480b8fe91b082316
BLAKE2b-256 75030fe5579a5607122ea123ae27f6c5cb5118b35548b6ac245e02479edff6da

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 491efa1dfc4c09bb4849ee0b8ada3a9f0a9f49d5fa6b2937b09c3788147fe13f
MD5 9b10f381b34a1678137db38d791ecca0
BLAKE2b-256 b8c113cc2b49c6665b1e12ee2860411f9e275619cfedd920f461312a87662550

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c44d000450c041afab5eb2a6d3d9be9d9343dcdbf6a4833cc7f1aba88edbe666
MD5 5497e8a645881ed217344be874f64f67
BLAKE2b-256 55010c2a51cb5d84a292e941f536b31732c6032df1628b20f7af11246452d884

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 f92c564f050676efebc6f4ae6e1f10e0d1d5e508ad04a01c00702b719d53b4da
MD5 bf327c32a5c0b0ad9db684fcc82c73ea
BLAKE2b-256 dc1e1b7f15140f211b4d6f08b77423835de682436c26a6ddbc36d01e79e99194

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp312-cp312-macosx_10_13_x86_64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05fd150e0bb1c84b39e0392e0e1accdb1eeaf79021961a705053c0c947296459
MD5 13bfff889e24345fdc73004831af3773
BLAKE2b-256 e93fa3cd9f95c9dc97d627101d9b49bd3b48da1779d35ba6b9db9c10a4695a05

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bc8bf8ad7f64c6f38b0ca472e9615fd01e96d3308675729d637dc13f7a7fdc8c
MD5 586ce0b70d7565b92733fbf3abdf75eb
BLAKE2b-256 c01b410421596721a9eda8075c9517c94b97fe660c8e2fc2f16b70ae3136a39d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4ecb4edaf9a2bc5b1ebc29b7ad6e60d026e4327072a4cb0bfbdb407dce730f25
MD5 64faaf829c40cfe98aa3d2bcd7d99bb6
BLAKE2b-256 b61bfb21acdd3457dd137bc8cf79693386f9c18a3a109d85c6f5d5a083c02522

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c263939dd2b357730afb9076221690ec14a88797b63149ee333015db2961e09f
MD5 513b5c8ec2f41b4cf2b883695fc9bf09
BLAKE2b-256 40e43e365aa6e82d5f5324526b79629ff015b5ec544a033bcfce504bb39ed745

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 87800cdfd919c26eacc8d5e613b73630fd872b1823809d7a83d093afd441521a
MD5 bdaa5c9d7b303c3f85e42ab8f3a58e43
BLAKE2b-256 92468ecf6746985c72b80942234401d56c5c5f436ed81f7ee082e2f89020b757

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 82582766e01944ed8e8dae32cb9592b2f7629f00371cf349ef7b48a04130c4fd
MD5 84d26551e617dff45c2a0ac21eb9020f
BLAKE2b-256 dee6803d9aab30ef2955045b1a3b94eb44eeaa1df8b2ef6d976cb6cd1e771395

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 277e1d95aa5241881da1e2e6e2e675280663d112c119b075a47f26476ce6bed0
MD5 17c26b9a1b2abf024247f5e0b836ff26
BLAKE2b-256 3ca9239d0106c39e732cfb853d39f3133b0f2d634088aa8996b46821293384a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openexcel_c-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8b383eef5ca00c8e603b8118cc04563c34a09af1fda988ff5ece7a3a8693098d
MD5 3ea263df199d4bbb6eba570b89757c35
BLAKE2b-256 ab25673c6e5a71abb8b4bea794791aa5dec260344c923198a7e70638273fe7e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl:

Publisher: publish.yml on karungop/openexCel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page