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

Uploaded CPython 3.14tWindows x86-64

fastexcel_keye-0.20.7-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.20.7-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.14tmacOS 11.0+ ARM64

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

Uploaded CPython 3.14tmacOS 10.12+ x86-64

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

Uploaded CPython 3.10+Windows x86-64

fastexcel_keye-0.20.7-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.20.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

fastexcel_keye-0.20.7-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.20.7.tar.gz.

File metadata

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

File hashes

Hashes for fastexcel_keye-0.20.7.tar.gz
Algorithm Hash digest
SHA256 f2a0e4c9e9d54f50a1b1648cb7fc9628a3d7d99b6266f9e15ae811b08233b051
MD5 80d8a9615c172a5509c4ae74b93ae56e
BLAKE2b-256 524c32e209a29a3584d4ccc868cb7ae67e4be57f5133898435aa69de23c88a3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 94fbb0b79555e26bb38b45520842b99e4140fc30035bdc03c13fc8bb1d76bcf3
MD5 50a1360f61ae81a55ab3262105548ac9
BLAKE2b-256 83bb3fa4cfc06c645d9d8ee4ae50924480177ef224c156abb47eeda9b39c8e34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5ea8a7533e5852cd575bf9e9142a0f7f9c313b761d2572fe53366bcf9a5a398
MD5 51fd35cfcc303405c321c1e78ac105ee
BLAKE2b-256 10ae888b6030696a95e646355bf54077dea5893bf6ebb4f27e9b7f61d120ced4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5b78b2f2bec33cb7253c4bc68785a1291dad4036138ee3c0738593d7584f96b9
MD5 2e17c54e73e3726925a26dad3339f167
BLAKE2b-256 b6d4fa7d880b2f5f704f093187d2696222dfbf45b9cd9478dfa650a05db137c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5a642d53f94138c5f8fcf0a36b289db0df35c09b66fb217043ea4b79d061d1cd
MD5 2bc0ad1d8362249a84b245614155c482
BLAKE2b-256 30d7cb9571a4e327ce0ee21ba9818a501448b5a0961d2ca247a0ee521732f76b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e57f78d8bbfca13713d43f960742b10d0647ddf4d8af35bd1fa84a612e4029e8
MD5 6e9fc444e42acfe674e07bcc71473913
BLAKE2b-256 92ae0cd37b0d07a89be0fc758ccc6b9dca736436fce1273fd9a85fbabd59af85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 88fa5f5380e0518ba3942fc6d565a41947c15e873852292988023237579d3a72
MD5 0d43e8715000dcb5eb37f0c3b83d36b4
BLAKE2b-256 385b77dfef39ea93022e6cd4c3b3085ed91ebbc69437211a769a8ceaf34e1155

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be518e8c9869ab5bb6e1b8739e41494b0e20a4d33e009ea1ad6b149a0c75242e
MD5 16b82381264c2b77e443c44f5e59260b
BLAKE2b-256 c6c6cea4f08f9a18763a8f7efa71cef5d2d9448e508f5d500b18388a60167e47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 223cbed69e5437d3dc382b7c5d67d5d6d3257df0b39ff7facc763fff3d640419
MD5 c101f4eb65c51ff11f50bdc7986b1deb
BLAKE2b-256 592a8887acf0b455c1d3b0af5a17d0e7d64a8497b8ef9d414c44c0345109cb50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91c5e032ebed87a106a7c9b9223d0521c6cb32569836c986004cd268f664f686
MD5 20ef5d1bd1fa216512caceb82fb2bb2a
BLAKE2b-256 19013d5f02e3b10a024b3dec75f44494f900d0612873313c01f0e10f2359eacf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.7-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 308eba94f4b59da865460e5d6205326ef39207f6b2df5e9559af06929d1c5bd4
MD5 77ef044ad94b2cb1453771812f2a6a2f
BLAKE2b-256 998e181ed4b69562f198a014426533b3d84b38dea7002d6a5312a1e3bceb93fa

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