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

Benchmarked against openpyxl on mixed workloads (integers, floats, booleans, dates, strings):

Rows Write speedup Read speedup
1,000 8.5× 5.3×
10,000 8.8× 5.2×
50,000 8.1× 5.3×
100,000 8.0× 5.3×
250,000 7.8× 5.4×

~8× faster writes, ~5× faster reads across all sizes tested. Speedup is consistent — there is no warm-up effect.

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.2.tar.gz (128.4 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.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (81.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

openexcel_c-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (82.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

openexcel_c-0.1.2-cp313-cp313-macosx_11_0_arm64.whl (70.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

openexcel_c-0.1.2-cp313-cp313-macosx_10_13_x86_64.whl (73.6 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

openexcel_c-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (81.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

openexcel_c-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (82.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

openexcel_c-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (70.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

openexcel_c-0.1.2-cp312-cp312-macosx_10_13_x86_64.whl (73.6 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

openexcel_c-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (81.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

openexcel_c-0.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (82.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

openexcel_c-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (70.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

openexcel_c-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl (73.5 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

openexcel_c-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (81.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

openexcel_c-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (82.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

openexcel_c-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (70.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

openexcel_c-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl (73.5 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: openexcel_c-0.1.2.tar.gz
  • Upload date:
  • Size: 128.4 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.2.tar.gz
Algorithm Hash digest
SHA256 9913f1f6fac270892062aae6ec7019903522a36f3f5ef8aadf545b7881a8854b
MD5 f6c011dbe63b7920b8143fef8877fdfb
BLAKE2b-256 864a629786f2223310146ae1eece16224ed1420752a405c43faa57cc465980b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2.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.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3a5bcb0b691c3833506dcb52e3c60100b50cae75f73150ba60e700703e48d824
MD5 b3b7593ad38b5db3ae401f7ac7122963
BLAKE2b-256 3a280a4927fcab246719fc1c185e1cfb082ceb6cb99ebcd82deb301d98c32aa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fb2d39551d6e5ab29d0e0bb2a04488dedd73cd102d01c975904fbe0e7f9a7141
MD5 ea2ac9684c1b9c5f3ae00d86a6abfcf1
BLAKE2b-256 cd7c54fcf524d88691eec2996b070a7de78df75ca3174a5dfa91fea4aee99400

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4778286926a43b793af7624e988ce87cbff9ff29addbd6da189a7ff0b7943cad
MD5 dd54dfefeb96e7f85f8d75f2b80cfb51
BLAKE2b-256 498a3c8613980d3619031aaf9cb0a8dc54a54a9e5f77e17d2581c91703e966aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 d1b4b47c111df98a8029ba0d023fa2adcef60548eb439b56e2fb61130c53612e
MD5 09a3727ed9d14993318084bf333f3249
BLAKE2b-256 98b0f130e9d68a4812d834c68719a5c466c3bae43dc2546223a93e2e2d8a8289

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 662681c7f727caaaebe713b7f6a67c357992e6aea036a29983c3822e87f67671
MD5 09bf4c1f76d610f6849546a60968dced
BLAKE2b-256 b1af5ca5ec815e1c5a1d7ca56048832c59d3224c16e81841a6436857f731aeff

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e87ec6e9e5b45739ce0b639aa0015506210019be87b410725d7e72e59110841c
MD5 5b6ad85b64897546548a52b046e4f9bc
BLAKE2b-256 643d02bfcdfeb3e69ffae960279674bbff2478b38745711cb93717dd6ba70b7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 64e2be3a5a0894207d182a3ed92ad319202786a195bb822ec679e946847e6de2
MD5 1380e284e1998954a101bd94db1fa38d
BLAKE2b-256 232959b831eaf8e9351e13ebe0d2037e220ad94230f2efe520080da9ccd8614a

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 4218ed323ea0c7b91e2862f99ae7e5a0557a689d286bdbf97188ddd0d22d65b2
MD5 61cbe722d467bba187d2f18d37498f94
BLAKE2b-256 172d0356781da16167a64dc05e47f31ff42bfc69ffb9da3562ba62c4f9cc8a78

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 32ca4fdbba67f7d2d01314020e6bfa52a0f69f8a4dc4d35265e43069bb5796f5
MD5 5ccfc16eaf421e8ab2be82395e6b94a5
BLAKE2b-256 1762938e05f93ac10e3ea0213f6cd145c41e720418b5b3c9ba33069981f76964

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2d9e133909e02cb0768d6ca11ccf2763e3ffb6f0443cf542f0556689820a719c
MD5 330ee982043b737b903fdcf4ac4e6161
BLAKE2b-256 dd7d499fe8ede27dccfad7a8bf0f745472466020e3ab356558226250b6021f87

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1ae50567d08278129715fcc904cb25ec920a5f644ad3273dc92b5f87f20c7abb
MD5 a1dc4d937d3c8c6a4736d3afbdd60017
BLAKE2b-256 0907c0a4a405e75e070d8c9aeca4997732c6eee22082f966c033b65053ecdb59

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fe5e94493e097748e8f3be02ca7dce699726e5e0ad66e207fb8f1e29d5d99e88
MD5 61a7cb94362201b7a823948b1547709c
BLAKE2b-256 2f244d45b547db2bb3711da519f0aab5a488d1fe548eda5863d18fcefe090679

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 857211eec0629dbce177358774cecf20ac5adc59dd77552990af4fa785f7813a
MD5 425aaf95d56e491525172809bdcd078a
BLAKE2b-256 6c0a7f5482bcb92f80c479f90edb2f775523aa6367435a2b69d74bb6023b5565

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0cbda46084699c63d67000ed9f4f973f43edf7600f02e18a4873cc5a2a93fe33
MD5 9edae94e025c41b743fddbb80d2adaff
BLAKE2b-256 792d02ebd380d22b19efdc6f0414fdd92de2c6c3a6428e523586286c3a311c50

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd38a176f408ee006d86a87191c3fa4e1726c40c08110c134d4527fb6657b155
MD5 af96177456e16405a109530d3f3de325
BLAKE2b-256 1541808a5b9718c71acedfd018ce22a98695ed1098e6ec4241fec424e03e4fcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for openexcel_c-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9ffcfa214692ddde6e71ec5d628d9d4829fc9b4d17348097a1df794efc9a0cff
MD5 7057ee24427b99df84ab61696d8eb936
BLAKE2b-256 044db32a5c0c97579e1e94107a709426e8ab8f07e18cba62174774a328e61297

See more details on using hashes here.

Provenance

The following attestation bundles were made for openexcel_c-0.1.2-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