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)
# With Polars support only (no PyArrow needed)
# With Pandas support (includes PyArrow)
# With PyArrow support
# With all integrations
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.
# Load an Excel file
=
= # Load first sheet
# Use with Polars (zero-copy, no pyarrow needed)
= # Direct PyCapsule interface
# Or use the to_polars() method (also via PyCapsule)
=
# Or access the raw Arrow data via PyCapsule interface
=
=
Traditional usage (with pandas/pyarrow)
=
=
# Convert to pandas (requires `pandas` extra)
=
# Or get pyarrow RecordBatch directly
=
Working with tables
=
# List available tables
=
# Load a specific 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)andsheet.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:
- Rust - Rust stable or nightly
- uv - Fast Python package manager (will install Python 3.10+ automatically)
- git - For version control
- make - For running development commands
Python Version Management: uv handles Python installation automatically. To use a specific Python version:
Quick Start
# Clone the repository (or from your fork)
# First-time setup: install dependencies, build debug version, and setup pre-commit hooks
Verify your installation by running:
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:
Useful Resources
python/fastexcel/_fastexcel.pyi- Python API typespython/tests/- Comprehensive usage examples
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
Memory profiling
Creating a release
- Create a PR containing a commit that only updates the version in
Cargo.toml. - Once it is approved, squash and merge it into main.
- Tag the squashed commit, and push it.
- The
releaseGitHub action will take care of the rest.
Dev tips
- Use
cargo checkto verify that your rust code compiles, no need to go throughmaturinevery time cargo clippy= 💖- Careful with arrow constructors, they tend to allocate a lot
mprofandtimego a long way for perf checks, no need to go fancy right from the start