Skip to main content

A fast excel file reader for Python, written in Rust (fork with style support)

Project description

fastexcel

A fast excel file reader for Python and Rust.

Docs:

Stability

The Python library is considered production-ready. The API is mostly stable, and we avoid breaking changes as much as possible. v1.0.0 will be released once the milestone is reached.

⚠️ 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 fastexcel

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

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

# With PyArrow support
pip install fastexcel[pyarrow]

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

Quick Start

Modern usage (recommended)

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

import fastexcel

# Load an Excel file
reader = fastexcel.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 fastexcel

reader = fastexcel.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 = fastexcel.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

Key Features

  • Zero-copy data exchange via Arrow PyCapsule Interface
  • 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 and Apache Arrow
  • Memory efficient - lazy loading 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 https://github.com/ToucanToco/fastexcel.git
cd fastexcel

# 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

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

fastexcel_keye-0.19.0.tar.gz (66.5 kB view details)

Uploaded Source

Built Distributions

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

fastexcel_keye-0.19.0-cp314-cp314t-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.14tWindows x86-64

fastexcel_keye-0.19.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

fastexcel_keye-0.19.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

fastexcel_keye-0.19.0-cp314-cp314t-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

fastexcel_keye-0.19.0-cp314-cp314t-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.14tmacOS 10.12+ x86-64

fastexcel_keye-0.19.0-cp310-abi3-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

fastexcel_keye-0.19.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view details)

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

fastexcel_keye-0.19.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

fastexcel_keye-0.19.0-cp310-abi3-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

fastexcel_keye-0.19.0-cp310-abi3-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file fastexcel_keye-0.19.0.tar.gz.

File metadata

  • Download URL: fastexcel_keye-0.19.0.tar.gz
  • Upload date:
  • Size: 66.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for fastexcel_keye-0.19.0.tar.gz
Algorithm Hash digest
SHA256 04bcf7a4688a8930fe309a7579ceeb3306004ee6ad8279e832255b98fe4fdf3e
MD5 e865a0178f7ef12729eba15d95c42fa4
BLAKE2b-256 f0e307014dd5c1d1feba29a65f60b6da8de61aec8d66877ac0832bfa336bdce2

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 7b5cc32010efd8d113ffb090970f25a5260d884cb206f84d962d9b94b29eba67
MD5 c683c4dd3f6563e1f84891e8c7a73c5c
BLAKE2b-256 256319675ac09557731e2f7c9e99536db3d9edba9c332e47c3bb4527956c2581

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa9944597bb64487101072809c6ab7c12ae0ba5211df3cbd680c3fc98ee5dc68
MD5 bd738814151fb66203c81bf3d1e47e37
BLAKE2b-256 034833b4838bf682448a618f51a6f12f11f798f9520e6931d346d7ea22ea03b7

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aa637868332acf4bb5869069c865b946fc2b3b60309016e04f6b7b73e92aa959
MD5 d4687e5d47346dc9509b606453447913
BLAKE2b-256 c8f7ae87d622958e03a407b4359e772d181e0aa9f5735d125901d6d6972dcc8c

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a90346dcbe7f0cfcd6fde47a64c5c1c8e3511db7f207f1e6835836f99add51d
MD5 678eeb323da4d33ac0bc6dc8bacd364d
BLAKE2b-256 5eb1c0c9d6c562246e4a3d05cf55af1524bb70db6e24555c8da13f0a09c2d949

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp314-cp314t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 879c5e67e03b6f268e759794e8f4b408e8ed0d0573902a9b567a2dd69c64e1ce
MD5 5db88cafb185cda0beb5af1313ad7c0c
BLAKE2b-256 7d7828e381767b6ff5fdee84c02f858d4b4320280f024a2042a19d1c80694a4e

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 216e7bd980dbfdc9c1744b50225932fdd94c6c23db42a250dbbf9a940c26398d
MD5 7a26ca0544089f722da404ccd5dba2f0
BLAKE2b-256 e5b99074d0019c6873344bca8a1098a137789ae55e1adfa8f1784f006c5f263b

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8201e74d73ba6b85de2fe26dc6934753d4c9ddf69bd8d5d7a7d23c508615b506
MD5 be742c20924d85d48fc2e8966cfd0a93
BLAKE2b-256 2f4829ef83eb7091db0f532b3c8922d5ed58bf5701c81a4f462efe2c8427f43c

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 487bc75893cbf477764ba365b1d3594cedfe2e425d63a71851119ecf4ad506d3
MD5 509a132d173eb9ab6cb804badd9e6b5f
BLAKE2b-256 11a44962c5c5261bd481ab9983f127f50aceb5305a05405b03db302022aa4145

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fc7a5f3d33661292bc4107e0dc30c45f5c453dca3d8799778315bc8f57c0ac93
MD5 0307373a60c415264b784c4b44ec7343
BLAKE2b-256 b33a5b3b877e766a10a10fd273304aadd3385697dbca9f49f28a54ec5c7b47e1

See more details on using hashes here.

File details

Details for the file fastexcel_keye-0.19.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel_keye-0.19.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7b228d7cf8a4ddaa90583d293548160ceaa61d411a8b5d5e25934ab5a0a5a0a6
MD5 2152d5ebcaa2164ca9739846ffb1b243
BLAKE2b-256 396738320617f3a1ced9bdd65ad4fb59ed87b67dc8fa9549af04f82ea3769ed7

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 Pingdom Monitoring Sentry Error logging StatusPage Status page