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.1.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.20.1-cp314-cp314t-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.14tWindows x86-64

fastexcel_keye-0.20.1-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.1-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.20.1-cp314-cp314t-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

fastexcel_keye-0.20.1-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.1-cp310-abi3-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

fastexcel_keye-0.20.1-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.1-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.20.1-cp310-abi3-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

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

File metadata

  • Download URL: fastexcel_keye-0.20.1.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.20.1.tar.gz
Algorithm Hash digest
SHA256 6b13ab4039aec45ecf7c4fe8c4e108cd8dcebc451ce4093814e0edb023cadb73
MD5 7052dfd5766c3ad8d5f0022e071834e9
BLAKE2b-256 6cab944a0993910af0789c6101f0d1793b5d8713592e0e7f42181e049adea010

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 3368abd961e03d749c878cc64545027cdf54b547ccc78ad4f1845fe97631f8a9
MD5 4b2c62e0634e117827e8407e5815de76
BLAKE2b-256 350e54d9ade9d08970dca692881a41c823b333a1e58f06be25d88036665a9dc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7a017210480a4b10f3bdb73d4071fbe87eae798d839283b391f9cb1b5aabe49a
MD5 d4f8b52879cccbd219465709f5ced0cf
BLAKE2b-256 3bc69b8ddc076245c3c1c4d1f1a4fcba971878ff49245092fe749c65f6906b50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9fc877cb0ab3afaff1a5ea367620b233580f32ec2192c8cca26c2525738eded8
MD5 a00f17004ccb697190a324588293c0b3
BLAKE2b-256 579df1b4ef2e6144a4477875d37bacbbcd445b4ab33a9d584c086bbfcc8cbe15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a5d772b1b9d0e73bd5131da4aabe98a248fa84d8d506a622b795b180d24ae99
MD5 398e3969f4f54fed244587732c6e8404
BLAKE2b-256 4fe61f8030ba0398bbb6b256bb4ff0b212fd2072ff75ace6430ad4a04b62236c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 daec992f383abda894c6573ac53abd4b8f190ae7b493d2e7b2abdefa03493d5a
MD5 de17efe5b7573b7883530cbd2b5742e1
BLAKE2b-256 5cff3dc19b9862140123ce9075c2d4ab203dd86a5823820ae7b30e9fe606f7be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e2b33820bb9312ea12be1a56b3a8ebba5319e532013ac4659b57d8af0f7f239c
MD5 b69ad249d487d3fb71b27fc4c4281d48
BLAKE2b-256 03c94d822afeb25bd44e6339505ff0a11fbaaed1842cfe8816672e2516abd712

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b358b0ad2276080d67fb0138a33ab0b4bdf1ab49ef692f2d6b1117c52f560d7
MD5 b597c830a3627c5943562608dd717a5b
BLAKE2b-256 b660f4154a064abb40a1c0a0bbdf2852e92edb2c539114d9e7a03a81b5991001

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ab30a7f3fcc5aabf578fca692fa49233bd8130bd0537e3409baf6f3eec1bc57e
MD5 4f2803dfe925a2523f7555dbfc6f6d36
BLAKE2b-256 35a796df64baf39bf4411a524ec2e2e75c64265d7a9b201cd327fac4718c833e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa0cee8cbabe924012f4ead8d5ff8802bcde9db4b4ec80a89ae806fedb8ce845
MD5 eec7c9e97816c393808285c01c116fbb
BLAKE2b-256 e61744955c8c99377c988d462658b6480fefa13bb961c43dfc88b92634385956

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel_keye-0.20.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 654f12801bd4836d17182966e9a216bc9595deabf281e36ebeaefb36df424a78
MD5 74554d2c0dc2e623b09c60fbf509c76a
BLAKE2b-256 2a0b102eccfa0928bb6dac79596d6455ac008df08b3097c7ec4853b04817f08f

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