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.4.tar.gz (215.4 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.4-cp314-cp314t-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.14tWindows x86-64

kyrax-1.0.4-cp314-cp314t-musllinux_1_2_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

kyrax-1.0.4-cp314-cp314t-musllinux_1_2_aarch64.whl (4.7 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

kyrax-1.0.4-cp314-cp314t-manylinux_2_28_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

kyrax-1.0.4-cp314-cp314t-manylinux_2_28_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

kyrax-1.0.4-cp314-cp314t-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

kyrax-1.0.4-cp314-cp314t-macosx_10_12_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.14tmacOS 10.12+ x86-64

kyrax-1.0.4-cp310-abi3-win_arm64.whl (3.8 MB view details)

Uploaded CPython 3.10+Windows ARM64

kyrax-1.0.4-cp310-abi3-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.10+Windows x86-64

kyrax-1.0.4-cp310-abi3-musllinux_1_2_x86_64.whl (4.9 MB view details)

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

kyrax-1.0.4-cp310-abi3-musllinux_1_2_aarch64.whl (4.7 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

kyrax-1.0.4-cp310-abi3-manylinux_2_28_x86_64.whl (4.6 MB view details)

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

kyrax-1.0.4-cp310-abi3-manylinux_2_28_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

kyrax-1.0.4-cp310-abi3-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

kyrax-1.0.4-cp310-abi3-macosx_10_12_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for kyrax-1.0.4.tar.gz
Algorithm Hash digest
SHA256 156cc131f1b7d10d2b31ac6ded5fc6f21d57b2bb88c0e76424bbd577b85c04c8
MD5 ef8a9de9a4fa3358502757087cf55e0b
BLAKE2b-256 173727ffc8118fc2a8c75bfc4145ec180c520c349084a4c106a407a44f8e5961

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kyrax-1.0.4-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 4.2 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.4-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 645441ae8286e8f913d3cfb4fec3d0dca6931faabca16f87a8642d8650d1e9e7
MD5 c2c192393d10db79eb9cc9866ccc76c2
BLAKE2b-256 ca5631541ec0ade4a7feac7ddebff5e323430098917f0080125ed6e29b4b046e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e73ab772b3a329a4976fc61561bc9b8683de77db5a3370a64921b09eb1f7ae69
MD5 7b58ac88fc6cc00921494ad4d38e5bfb
BLAKE2b-256 d8157482deea2a97ba438316963522ca444296ad434cccd49051f9cb98efce56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8832375215edf767e8ac633405a0796a54b59b8d174a3008bf85f6533fd186fa
MD5 0859f3cc751acbd4ed983253c5284b28
BLAKE2b-256 9420f5cc7dd7a213b6f4ceafc3957027a12eee3861948047df467255838b32c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8ad9850d7a96dff5ad26c5065c19cf1a801e95aac1ad3f043e38a9d8b2464493
MD5 bc579455e7b56b0e5aee96cecb54612a
BLAKE2b-256 0f1abbecb7862d2d7871017ee24c309dbba99a994a2ddc00a402431357f6632a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 64481745ec683b862599f7d1075caac5ce4ffc899919d1e81efe4731f4bf1ee0
MD5 323e55fb73e74dd934120588d50a1a27
BLAKE2b-256 18eaef1d829dd1c8e7ede1a6871a6508239367ad64da649303e25dd2038ff1b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3ab727f258d03e1e0e54698ec2f38e22f8db8b5fffb58ed673ebe74fb0c32eab
MD5 bc056a53b29ac70e0ccea569234a435f
BLAKE2b-256 3cfb3fb09173693e3d589f1e4f8a6aca5e4db34959585404e23d4d3294906309

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 29e5561612af0efafbf0bd7121733c6875bb756acc8149dd264baa4ac497fcfa
MD5 9ceb8faae55a2041da79154a5353b17b
BLAKE2b-256 78caffa5c8c595aacfe7462f9c36e46f6e08188b0312a6a085299c346838c2ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kyrax-1.0.4-cp310-abi3-win_arm64.whl
  • Upload date:
  • Size: 3.8 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.4-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 203e53cead14c886f15c40eccd0b2139645ec56aec3ee743d56a1e1f03f98233
MD5 9b87674a9db70d365b48554f0eb61147
BLAKE2b-256 2184b792ca24328c7586d67cfa0e5e06d183a254fb34bd5a75e558dac943cb5a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kyrax-1.0.4-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.2 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.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 db31eff512cbfc99bfeef2188d63f9d8ea079a8b5153a6ff39b3674f389f5755
MD5 777d679f7a37df0319f62fefd6a8695f
BLAKE2b-256 c30e739e9d38b36e7829b5c694e5568578334abc83d872f5eba0075222666839

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 34ac14c9a6ec9b6aec505875349fd5f32a59b6fdf4b4378d759e30895a3e9da0
MD5 26bbdcd09585974efc4ff0a73bbbaffe
BLAKE2b-256 2fc10696fa43ee43a6ed0a9a0dc00b487ce5888de7f1c78df6530f19e0e50e39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a52761a0836887293e0296a5b8e1c8ecaf313e2d9d01f293ea8421db3f2bb2b1
MD5 84edcedc46d0a47540f377435d781dd6
BLAKE2b-256 12b9c16b5f0a25d8176286533cf0d1eb688bd146272297cce2c3b66768b4cbf2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 35483c3affcfa3a5f5e29890074340e3c485ae2cfdbdd5d6f26ab3e6c2b05a2a
MD5 557e6882b1c892a9ee3fd9c909b53cbc
BLAKE2b-256 b586323291dbbc32d1af27a2fd1d4f6d3e3e2cad84c30c17b0be4e74722dbb00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ef2e32602ce3b24923ba93aa51a75421244302eeb91d090759dddc978ae467eb
MD5 01621a764c5ee1c46370d431487af261
BLAKE2b-256 53e2fb295665e3bcf4bfeeed4fd237cd481641d7fee6a74711ad21786d9eb503

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 577ba8386e3de4569dcd79fdaa4824e8815fce20d44603967f589fa80b629703
MD5 ac4b7daf68640d724ea256aa3358d3e3
BLAKE2b-256 28475d5608ed281fad6e0d7f687b1d0149be7678573b320aa7067b7bc4a121ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kyrax-1.0.4-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ea1f687b64f3c08ce7c12fed32bfda2a30859b14d6975c0e1ff5060d8e03fd41
MD5 ba6f83fa04cdaa3ccba91a9a8cacbd9c
BLAKE2b-256 86a0b15b7c875ae8a23b276010edc075a6fd02990b0478ada3a73adb7e429836

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