Skip to main content

A fast excel file reader for Python, written in Rust

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-0.20.1.tar.gz (60.9 kB view details)

Uploaded Source

Built Distributions

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

fastexcel-0.20.1-cp314-cp314t-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.14tWindows x86-64

fastexcel-0.20.1-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-0.20.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

fastexcel-0.20.1-cp314-cp314t-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

fastexcel-0.20.1-cp314-cp314t-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14tmacOS 10.12+ x86-64

fastexcel-0.20.1-cp310-abi3-win_arm64.whl (3.0 MB view details)

Uploaded CPython 3.10+Windows ARM64

fastexcel-0.20.1-cp310-abi3-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

fastexcel-0.20.1-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-0.20.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

fastexcel-0.20.1-cp310-abi3-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

fastexcel-0.20.1-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-0.20.1.tar.gz.

File metadata

  • Download URL: fastexcel-0.20.1.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for fastexcel-0.20.1.tar.gz
Algorithm Hash digest
SHA256 1ac5e9190a8f3ff690cd0fe3e302eb8e295a297c09ea4735d81d6e02fc4dfd99
MD5 7502e39f14b02fcf2e357835a23fc95c
BLAKE2b-256 2d77392ccdd44c7db3be5706ede5fe2c3cb3c7e98d4d5206a1dcbc75b20f6f0c

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 85e353ce2ffb71e34f79d81bb4d6057e8c748ab35a77f24269da5193d421ac1f
MD5 f3dbefd34ef30c0fdab3f04e7a2db09b
BLAKE2b-256 95da178a9d0022d16229c4e9e0be14772a70da5b58c15e2d0b958dabcd84d2a6

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d2d667bfc8e7b9e6fcfbabf7665fd08da2b918a3015e8d84dd0af7bb01ba26d
MD5 684c8a0d7a7bc04e76964b713ce45550
BLAKE2b-256 852d44e1cdacd3a849b5777c7d8e17f84ebe4b202393c2b030c1264f16a5f026

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c6927f2306f60235a807de1d0f0cf0e1554026a68b0f7c08cdd6de0bbbfef4ab
MD5 995b17379c0aaf7936322fe51445abb8
BLAKE2b-256 c4055fb41d3f48396ee5e53500fb877fecca526bbdc3a9a3296f6889e8418813

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c315fe844dce2dae83b249ee4f974903d906db01b7db822944ef93003759ba94
MD5 13580c33ef686d2e660a6016e4e0ec4c
BLAKE2b-256 fdcbeb266cd2393a89693c113ae954cb4e152f92f188e6f659e91b7ed3605103

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp314-cp314t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cdb9c5cd454a6cd8a5dd9bfdebb5d978887d62f6322f55b3d4a32303aded807c
MD5 8496890f967b911c3e26cdc2a0d4256e
BLAKE2b-256 d379fa2c8173ac0ed6757348df0d49bd9e0fd40b53b1e8d376ca295e82fe55cb

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 fa1ef0f26950e8fa558bff663726d4c45eed5ce1b21ec008fcfc3f6089f47426
MD5 7101b57a501775130d7b28e9316987a3
BLAKE2b-256 ad497ff029f28b13d54c528cbd51b65ac42a4ec97c3a481bd5b956e3a041ea4c

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3a5b2539ecc6122dcc2488a06875f5f494edcc5a6413fe7d04b586f242de7707
MD5 fdd7ecea0653d6f83487727694e02972
BLAKE2b-256 354f5f4301f8665d3d33df1364a7fbb435aa8da228333d38f90075ac17f794cc

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc95675d345f2c178d2546aae5841debff01f9edc283ab0416d0375906164f8f
MD5 aad9b6e1c500f9cc337586d57684e564
BLAKE2b-256 c6d8ac91a54bfba4f12b2efe5cd1b3dbb42243912213f6f77006d69e8c98c6ff

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8b04b8ed447ee23bc03a907489a01f3e8e87f2c410f6eeb2991c5f9fd5bd3b9d
MD5 f1a98e589550a5f4b41d82098c6a866e
BLAKE2b-256 a09b71a6f9a1e22cf4c064239abe575aa5b677c84f317129118ea467f1360eb1

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cdc26fc3d2a7689cb29f1e55851e12085f33a3ed6f4571580e7fd130e2b1bcf9
MD5 79bafda45e7a318b5debc944abec76b0
BLAKE2b-256 db0855bfe83a4a2248eea61d78d8c4b26508c0c392796d09a87aee0615d3f709

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 db5b708555c42d05dddde9b4f61bfe0be4743bc754af8673cccc7c4508da8609
MD5 63e88129c37c529c29f0c8f38c7764ba
BLAKE2b-256 ff4903e2fc728b2893e84dbf14bce60c89022a3abec008cad255435765228833

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