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.2.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.2-cp314-cp314t-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.14tWindows x86-64

fastexcel-0.20.2-cp314-cp314t-musllinux_1_2_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

fastexcel-0.20.2-cp314-cp314t-musllinux_1_2_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

fastexcel-0.20.2-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.2-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.2-cp314-cp314t-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

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

Uploaded CPython 3.14tmacOS 10.12+ x86-64

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

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

fastexcel-0.20.2-cp310-abi3-musllinux_1_2_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

fastexcel-0.20.2-cp310-abi3-musllinux_1_2_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

fastexcel-0.20.2-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.2-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.2-cp310-abi3-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

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

File metadata

  • Download URL: fastexcel-0.20.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a4be10eb0f4dd819d2b36950b3f26bf87260b53e54150ac02b78e524c7063902
MD5 8856206e86e1829f2e604af0825a1523
BLAKE2b-256 969624314765a3204081a55ecc96e83dfdbd2ef82aa80a521ac3005b2c91e941

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 d71e2a1fce006cb8bc1ae06da6ff5e5fe83e6496be5aef01b623b15aa0d0f82d
MD5 780d48291ac36edf41a2fe7522c958e9
BLAKE2b-256 3a511d9a72473cc213d5647d8cf7c2393ef995b3453ac5e4b544ba652d1428dd

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.2-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c3058d034e75967b6f01e0c82767adeb40cbf4533b6bc54e3b93f77f5f80dec4
MD5 38b8dd61ee220dfa630d7314447e0921
BLAKE2b-256 f734b3ed819dd6d35d71c6640ff857c6362d42f19e8b15354e64b06f355df3a4

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.2-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e5b23f69898f6a32c2f279d8f72eb8ac93c336bf7f453a9b8930cab9dc494520
MD5 7f5bb71d0200774b423672286185aa71
BLAKE2b-256 3482fabe2d1de28e89a90bb2c884c37d862b5d85063fd41fffcb56b2980d0b51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 db049d51e5323459f534ce9a65869f997bebd4dde75ef1d3b3af53dd64b8b9ca
MD5 03f79df26692f7794c8dac2fa6eb35cb
BLAKE2b-256 4ce0f67911db6515df326900e8ac1ae17cc08233ca5fb8f71c633f57a50cf786

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 675d7eab2110bd8d5520b98d5eb3f3e15173b69a5f64b43412f917e9717e9aa0
MD5 108c05a5d7c82f40d3831d736815bf95
BLAKE2b-256 ddefbd7b98149b50e01fdaa3b146b025ce50b8e983f35522f8e69bd94d2711a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9692ac135ede4d6fc45b25cc22f1c6bd1eb8750bda14097b7f319450c33d3124
MD5 ae5d2757c5dafd2111e998ee5bb253b8
BLAKE2b-256 80bce492c343c096e93e269c157fc11def297430047f1ee09db4f8a39bcdc1a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e5b677d669cc7c099998ef27d9442b78d7190916d3b40418bda619cdc4ebae2c
MD5 0b2c9581636f3c7196cb5f61019640de
BLAKE2b-256 37d3fcc1ba752415327f0fd5a1b52060e66f1c0bf8b7b90bbba781b91750ce7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 c3e58f5053bc05b0ee8fa735056cea7af6e1c41c39fc4b2b06cc86c1025d140b
MD5 2fdd8bef1e65f61eb08bbe0588b27343
BLAKE2b-256 d83bc251f38596d630e87280c191f53803e7409e7723e95e53a477f6760c7298

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ce28748390ae6a7d286ba29d8ee2badcfb6478d32ed700db6c2030de32a16e7b
MD5 47ec40eccb0fa248bb6d7e911bd5782b
BLAKE2b-256 22b37de6b49406fda63c9fee817d5fc70fe3f52c24431605f1de2f7b0f3a0938

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.2-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8b15f21baef3e4914071e34f176d8692dd79e3464c10f8373047aab1384cfaae
MD5 b6817a6426270fc057861456bd65486b
BLAKE2b-256 c0804548305ce4d70a0ecf38205988e5caeb9347dae7e5d06bcd2b939586fc52

See more details on using hashes here.

File details

Details for the file fastexcel-0.20.2-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 441f9b7e97b4fd1c9487e5c0a0d9cad7aa4097a39e65fcd494551f5ec3e5d02f
MD5 9a33182907343fa106c7c063ebe3a661
BLAKE2b-256 c51580c614c8b07c631c7c2acd015e7f2e1cd683cd04279e5615b39c36a0e43b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 15d41bcc4433bb3ab778426ecaeaf3a5f38d949555c631a83e958c57bb0a116e
MD5 884ed38bc729a2714ff087db4e3d7071
BLAKE2b-256 b401da0ae9b3ee86daca5ac9f0a7b05477cf0c1624321d95f1e52492a772dba5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cdab3cc439c18c4ee14c4ec2b321e1d927cae84f557525f390a3c28517f6e721
MD5 e6bd3243ffa8151a42ca9a6d0483072e
BLAKE2b-256 369ca8f45e5c195a70a408893b348595bae4c113091dddba7d1b029e9c980b8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c7e58cf83c873743c18006e3866d5c2b69c34df7a4a253a72e81169853ddf0e
MD5 36f34b1bde8da5f02667d3b91a61e8cb
BLAKE2b-256 3f2bf78a2df2d93ec4a23d7fc94ed967bf004d5115e1f4d2da389bb888d2cc32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastexcel-0.20.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2a240b9f4b6af42cafc247c1b8c956cf32f5393a3956ad0ed49e07b2b5bf0e09
MD5 6d88a3f8f2bc34f9614a74a0a4423762
BLAKE2b-256 2929acc5b2eb95fb4eaeb3486b6f034f2d9754dcc0cc0b5dbc79b2fa9a31f66b

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