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.20.10.tar.gz (71.1 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.20.10-cp314-cp314t-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.14tWindows x86-64

fastexcel_keye-0.20.10-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

fastexcel_keye-0.20.10-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

fastexcel_keye-0.20.10-cp314-cp314t-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

fastexcel_keye-0.20.10-cp314-cp314t-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14tmacOS 10.12+ x86-64

fastexcel_keye-0.20.10-cp310-abi3-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

fastexcel_keye-0.20.10-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

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

fastexcel_keye-0.20.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

fastexcel_keye-0.20.10-cp310-abi3-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

fastexcel_keye-0.20.10-cp310-abi3-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for fastexcel_keye-0.20.10.tar.gz
Algorithm Hash digest
SHA256 d28dfead4868674f099e704d598b1a9d9e6efa9eea8a60986fdd43efb9077dba
MD5 ce3d8afc380ec1453137183130d06c82
BLAKE2b-256 e1e1bc0ea03a749ab766eef01be79abca21266939b626108f53d5c0727941ad1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 6baa9f33f463986c1a275ea5cf2698b6f423a9d697a48dfd34d10fb071967a80
MD5 9ccfcf176479691a25c9875d0edbad34
BLAKE2b-256 284ca83fd4a5ec3c786caeaa021b4609ed0431450efaaa956594042a08a119b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54c65e28c0a537dd98a6112236aa6911b2a63ddf9dd0616d4e67f5687869d082
MD5 88726d7a080ea5be82c6ad9cf0e76993
BLAKE2b-256 083f313c6e1beaac6b088137a62273dca6c9c1e2cbd8f27bcda135f0c542009b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 50578591c87943023c8bbc53f30714515736bdca0d61f8553542e8ed3dd1c992
MD5 b51f19a6c7d241f5b595a6328a2ab12f
BLAKE2b-256 a70dbf9bbed055d640035c686e7c8cb94dc61051cbef9ccf0985276e28de49e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34b0245139ac8c046d5b7c85f7cae5f0d8405e5dae6882ee09d3886bc5f798d3
MD5 d9d105514e31d95f1782f7e6d9d36904
BLAKE2b-256 236af1d62c35042581f93cd19ea907650347513c157fd912be95422c8d9a3c23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 640a9895f2a24fda7573a615425972798df99fa494657d0cd11074df0a8ee27a
MD5 71b49b730e392588794abf9f57cdc839
BLAKE2b-256 9c6885cf36504058d3d60c5ac94ff127696a58799e92c2bad870f420ee44afec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a366bebd1ea65e218f7d460355fbf334aafabfeea47c4cb37486f3442ae94be0
MD5 5054aef2718fd000496c0316b6f12560
BLAKE2b-256 dcdb816b538bfd5764ad6d64a1a1617c5ee366e1aac12ac9a53fe71545a5eca2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ee8b182349664ba704e19ba567f534b7cd0df0bf05cd707f22699f33199aa96
MD5 718c6a97c8c2349adfd455531f4f2da5
BLAKE2b-256 1ff71adee4838ee010a7014a644dd5e4e64e683fd9076db0ff997e912ecdac84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0b66158a7681770c2ab37533301ebe62a83c20a99d528d1fb641c73d9e97a001
MD5 80db4bb8a3919a9d2c941fa12ac2646d
BLAKE2b-256 94be81e476ae7fb01c3dca52a0d299c6c5d0682ee4e38d7d1570c885d17a657a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94a662933c8319bf15c49dd877e09787c76d77ca78c8e946180fb49bb93d5452
MD5 cbe7ce5fd830892a38a8595201a95b85
BLAKE2b-256 4cb5f13cf9f90815d33daeb8a994c2a779ad5ce3a1f4eac22e3ee9dd7a0e4951

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.10-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 911547774d9e414eb6fe1ff88c65d3cd2aa6b28ce50cd331d713849f48791a79
MD5 dc448fa848c4bb0b256bb8833c43944a
BLAKE2b-256 cd1dfdcfa3a3ed51064401cc185d83ee2ffaa395ef649ff75641563f64394c74

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