Skip to main content

kyrax

A fast excel file reader for Python and Rust.

Docs:

  • Python (local: make doc-serve)
  • Rust (local: cargo doc --open -p kyrax)

Stability

The Python library is considered production-ready. The API is mostly stable, and we avoid breaking changes as much as possible.

⚠️ The free-threaded build is still considered experimental

The Rust crate is still experimental, and breaking changes are to be expected.

Installation

# Lightweight installation (no PyArrow dependency)
pip install kyrax

# With Polars support only (no PyArrow needed)
pip install kyrax[polars]

# With Pandas support (includes PyArrow)
pip install kyrax[pandas]

# With PyArrow support
pip install kyrax[pyarrow]

# With all integrations
pip install kyrax[pandas,polars]

Quick Start

Modern usage (recommended)

kyrax supports the Arrow PyCapsule Interface for zero-copy data exchange with libraries like Polars, without requiring pyarrow as a dependency. Use kyrax with any Arrow-compatible library without requiring pyarrow.

import kyrax

# Load an Excel file
reader = kyrax.read_excel("data.xlsx")
sheet = reader.load_sheet(0)  # Load first sheet

# Use with Polars (zero-copy, no pyarrow needed)
import polars as pl
df = pl.DataFrame(sheet)  # Direct PyCapsule interface
print(df)

# Or use the to_polars() method (also via PyCapsule)
df = sheet.to_polars()
print(df)

# Or access the raw Arrow data via PyCapsule interface
schema = sheet.__arrow_c_schema__()
array_data = sheet.__arrow_c_array__()

Traditional usage (with pandas/pyarrow)

import kyrax

reader = kyrax.read_excel("data.xlsx")
sheet = reader.load_sheet(0)

# Convert to pandas (requires `pandas` extra)
df = sheet.to_pandas()

# Or get pyarrow RecordBatch directly
record_batch = sheet.to_arrow()

Working with tables

reader = kyrax.read_excel("data.xlsx")

# List available tables
tables = reader.table_names()
print(f"Available tables: {tables}")

# Load a specific table
table = reader.load_table("MyTable")
df = pl.DataFrame(table)  # Zero-copy via PyCapsule, no pyarrow needed

Turbo Read (high-performance XLSX reader)

read_excel_turbo provides selective feature parsing for high-throughput XLSX loading:

import kyrax

# Open workbook for turbo reading
reader = kyrax.read_excel_turbo("data.xlsx")

# Selective loading: values, formulas, styles, merges, comments, etc.
sheet = reader.load_sheet("Sheet1", features=["values", "styles", "formulas"])

# Access Arrow columns, cell errors, style indices, formulas
arrow_data = sheet.to_arrow()
styles = sheet.style_indices()
formulas = sheet.formulas()

Turbo Write & Streaming Export

Declarative, high-speed XLSX writing and streaming export:

import kyrax
import numpy as np

# Declarative write from sheet dicts or NumPy float grid fast lane
arr = np.array([[1.0, 2.5], [3.0, 4.25]], dtype=np.float64)
kyrax.write_excel_turbo("output.xlsx", [{"name": "Data", "grid": arr}])

# Streaming write for large datasets.
# NOTE: "columns" takes columnar DATA — a list of column arrays, not header
# names. Headers go in the first entry of "rows".
kyrax.write_excel_turbo_stream(
    "large_output.xlsx",
    [{"name": "Sheet1", "columns": [[1.0, 2.0, 3.0], ["a", "b", "c"]]}]
)

Edit Mode (Byte-Preserving Round-Trip)

Modify worksheet cells while preserving non-<sheetData> XML structures (cols, mergeCells, conditionalFormatting, dataValidations) byte-for-byte:

import kyrax

# Load workbook in edit mode
wb = kyrax.load_workbook("existing.xlsx", edit_mode=True)
ws = wb["Sheet1"]

# Update cell value and apply cell styles
ws["A1"] = "New Header"
ws.set_cell_style(0, 0, font={"bold": True, "color": "FF0000"})

# Save byte-preserving changes
wb.save("existing_updated.xlsx")

Key Features

  • Zero-copy data exchange via Arrow PyCapsule Interface
  • High-speed Turbo engine - selective XLSX feature reading (read_excel_turbo), declarative writing (write_excel_turbo), and streaming (write_excel_turbo_stream)
  • Byte-preserving edit mode - edit cells while keeping original XML metadata intact (load_workbook(..., edit_mode=True))
  • Flexible dependencies - use with Polars (no PyArrow needed) or Pandas (includes PyArrow)
  • Seamless Polars integration - pl.DataFrame(sheet) and sheet.to_polars() work without PyArrow via PyCapsule interface
  • High performance - written in Rust with calamine, rayon, and Apache Arrow
  • Memory efficient - lazy loading, zero-copy NumPy/PyArrow paths, and optional eager evaluation
  • Type safety - automatic type inference with manual override options

Contributing & Development

Prerequisites

You'll need:

  1. Rust - Rust stable or nightly
  2. uv - Fast Python package manager (will install Python 3.10+ automatically)
  3. git - For version control
  4. make - For running development commands

Python Version Management: uv handles Python installation automatically. To use a specific Python version:

uv python install 3.13  # Install Python 3.13
uv python pin 3.13      # Pin project to Python 3.13

Quick Start

# Clone the repository (or from your fork)
git clone <repository-url>
cd nextexcel

# First-time setup: install dependencies, build debug version, and setup pre-commit hooks
make setup-dev

Verify your installation by running:

make

This runs a full development cycle: formatting, building, linting, and testing

Development Commands

Run make help to see all available commands, or use these common ones:

make all          # full dev cycle: format, build, lint, test
make install      # install with debug build (daily development)
make install-prod # install with release build (benchmarking)
make test         # to run the tests
make lint         # to run the linter
make format       # to format python and rust code
make doc-serve    # to serve the documentation locally

Useful Resources

Benchmarking

For benchmarking, use make benchmarks which automatically builds an optimised wheel. This is required for profiling, as dev mode builds are much slower.

Speed benchmarks

make benchmarks

Memory profiling

mprof run -T 0.01 python python/tests/benchmarks/memory.py python/tests/benchmarks/fixtures/plain_data.xls

Creating a release

  1. Create a PR containing a commit that only updates the version in Cargo.toml.
  2. Once it is approved, squash and merge it into main.
  3. Tag the squashed commit, and push it.
  4. The release GitHub action will take care of the rest.

Dev tips

  • Use cargo check to verify that your rust code compiles, no need to go through maturin every time
  • cargo clippy = 💖
  • Careful with arrow constructors, they tend to allocate a lot
  • mprof and time go a long way for perf checks, no need to go fancy right from the start

Download files

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

Source Distribution

kyrax-1.0.5.tar.gz (734.8 kB view details)

Uploaded Source

Built Distributions

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

kyrax-1.0.5-cp314-cp314t-win_amd64.whl (5.0 MB view details)

Uploaded CPython 3.14tWindows x86-64

kyrax-1.0.5-cp314-cp314t-musllinux_1_2_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

kyrax-1.0.5-cp314-cp314t-musllinux_1_2_aarch64.whl (5.6 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

kyrax-1.0.5-cp314-cp314t-manylinux_2_28_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

kyrax-1.0.5-cp314-cp314t-manylinux_2_28_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

kyrax-1.0.5-cp314-cp314t-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

kyrax-1.0.5-cp314-cp314t-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.14tmacOS 10.12+ x86-64

kyrax-1.0.5-cp310-abi3-win_arm64.whl (4.6 MB view details)

Uploaded CPython 3.10+Windows ARM64

kyrax-1.0.5-cp310-abi3-win_amd64.whl (5.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

kyrax-1.0.5-cp310-abi3-musllinux_1_2_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

kyrax-1.0.5-cp310-abi3-musllinux_1_2_aarch64.whl (5.5 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

kyrax-1.0.5-cp310-abi3-manylinux_2_28_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

kyrax-1.0.5-cp310-abi3-manylinux_2_28_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

kyrax-1.0.5-cp310-abi3-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

kyrax-1.0.5-cp310-abi3-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file kyrax-1.0.5.tar.gz.

File metadata

  • Download URL: kyrax-1.0.5.tar.gz
  • Upload date:
  • Size: 734.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for kyrax-1.0.5.tar.gz
Algorithm Hash digest
SHA256 6d46eefe70f91304a7a8c84ff2ff65db63c3c7f1111597b7fc73d9a897f3a50d
MD5 a2eab380123b4e46f7b04c75046a4e22
BLAKE2b-256 355391532f36ff52c48cc21c95c3bdd43bd4b9e88e067880c47acf4518b14cb2

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: kyrax-1.0.5-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for kyrax-1.0.5-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 00fd86e161ecb99ee29f1e25894a25436932bc02778a197c5aa331586206a7d6
MD5 4ddb0524af3f063f49d00df039597180
BLAKE2b-256 d1837807272bae5e253757ac2e98ba589062c818708585454598bc982b40438d

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9baea7eeeac2b6eb46c244745f476956fd2fa7e2e8a8ceb1e461a358c820ce48
MD5 8bd3d186612c7ad2c9685f0fa1ff0b22
BLAKE2b-256 a7ed7afac536956be0781d77f232ccc5e95775649175c5901dd34d466e7bed55

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 93d61ddbdb1a323c0586f9694542fa80ce6c81bf882671e443fe249d95d12dc4
MD5 750ab68522def268d7a95dcb9e73c6d1
BLAKE2b-256 a315db93d79f9a5cabf3d827dd99e2d1e1da973031b3943cdda0c9adc277bc1c

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 77017aed61ec198e20d87aeb3f8a4e0197cb33977510bbe4a23ed188550dcb05
MD5 d278617ee3ae2f4d128c298f612a3f83
BLAKE2b-256 40b9ff2f05759e7eac48748ff4a484018ebb507ff88b4c50bb2431103170e4c4

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3b81ab4d98769ec619e67996a2c00676953bbec2e4de90d1d5f3c7920bedcc52
MD5 5438a9c7419c83e56b61ec08dae01582
BLAKE2b-256 fae5803565352c335272cbbf8cc0023ede154cfe9af0ff9d6becaeeb1d3e25d8

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 340c0e85373b085a27be41cc222f8e2ece6ed030b0037df5a7718927215a2a80
MD5 faf14f1fa1ad901859610cd6e033c59f
BLAKE2b-256 3472e2d90ff41c7c5f2cee3e872a7d7586096c0966f382b7e6e249becc3480d2

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp314-cp314t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0a17b194ab1d1dd5d7c8928807a8ee34c50c7db4f5dc7ec7dcfe7515f55c767f
MD5 86318b7d39efaf33ba9f575f52fd47c7
BLAKE2b-256 8845b9b9b1a1ee970ef02549af8b94c174ecba0b97b4a9534a64f436853de496

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp310-abi3-win_arm64.whl.

File metadata

  • Download URL: kyrax-1.0.5-cp310-abi3-win_arm64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.10+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for kyrax-1.0.5-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 ca4f6bddf5382e7b8f76fb832db3c7ea82284ad08ef5c613684e7b232c0af0f3
MD5 2b9915d3fa763f62081d948d0caca744
BLAKE2b-256 2d1600e00a573624ac82be8e7d76a354bc837abd73b9b665e45a1050161eaaf8

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: kyrax-1.0.5-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for kyrax-1.0.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a8fb613aff8ed1531c483b060c5f5d8edb9bcab17f5a5ddc5798e5420880b6ee
MD5 aaac6a46919fbabeca858e2d1c32adfa
BLAKE2b-256 475fd4d2686f6eed8859114436c928e89afd43ce5150544731862a175ac0cb86

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4729dff9aa0683458dc7acffebf884f215ad680e4b6ed8e36b59893b9272b0b3
MD5 423e3cc98c9062cce2fa358859180f6b
BLAKE2b-256 f5c3cf26f493c2a0b2c1c7f73d3b9b40846e2bd68c84bad178c34988dd9e1bf9

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6a8e932b407a5ccbabdc70762cbe8a0ea39d17a5a39f8adc4cac0cf5faec090c
MD5 aae03b352b17d92d222b43538d4f2804
BLAKE2b-256 0b66e22400a7e4b8ce1a1448bb266d880e6f24b10bfabaaebe164c1e29d81874

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3d924341f34dc8993afd7506d9d8620d3ed6f3ffdc13c3b17d8ebab20e7f51b9
MD5 d6503040f1897bfb3399477eed820963
BLAKE2b-256 26485580abd20a205f935500d6604eaedbad5b1fa260c32873f8b1d8284a0979

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fabdbb08882cacea21e0fe0983c10520679ff2578ca27c931b94f362548364df
MD5 f737c5845120471e5343af53ffe465c9
BLAKE2b-256 1dbbb40bf1a8312861d90d51902a1d5179b89f515a3a66110a7b05f15df1349d

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9ef7cceefee25ed1b2504c9f1f0a81f4d553e0d87e2af6d6244cf35fc55d968
MD5 90e35278c5bded0ac161c5a7ec4e1c88
BLAKE2b-256 87f3743a57f94db439729599814a7eefca056f8da8dbe119e7f30e32464e9ed4

See more details on using hashes here.

File details

Details for the file kyrax-1.0.5-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kyrax-1.0.5-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e6a5f10149f33a1bb15228216d3b6da889164a53c67e77f8befc3008241417dc
MD5 be085aa09a315dd7b43488e02b59c744
BLAKE2b-256 23a26f5a04fe8f6da85ee89d2a36c15f2ccd3c37970920d00f75baacb7b95759

See more details on using hashes here.

Supported by

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