rustypyxl
Fast, dependency-light Rust library for reading and writing Excel (XLSX) files.
Pure Rust, no Python dependency -- use it directly as a crate. The
rustypyxl Python package on PyPI is a
thin PyO3 binding over this same library, exposing an openpyxl-compatible API;
this crate is the Rust library it is built on (and that you can use on its own).
Usage
[]
= "0.6"
use ;
// Write
let mut wb = new;
wb.create_sheet.unwrap;
wb.set_cell_value_in_sheet.unwrap;
wb.set_cell_value_in_sheet.unwrap;
wb.save.unwrap;
// Read
let wb = load.unwrap;
let ws = wb.get_sheet_by_name.unwrap;
assert_eq!;
What it does
- Read and write XLSX with full round-trip fidelity for the parts it models
- Cell values: strings, numbers, booleans, dates, formulas (with cached results)
- Styling: fonts, fills, borders, alignment, number formats, theme/indexed/tint colors
- Sheet features: merged cells, data validation, conditional formatting, tables, autofilters, named ranges, comments, hyperlinks, page setup, protection
- Streaming writes (
StreamingWorkbook) for constant-memory output of large files - Parallel worksheet parsing and row generation via Rayon
Feature flags
fast-hash(default):ahash/hashbrown-backed cell storageparquet: Parquet import/export viaarrow/parquets3: load/save against S3 via the AWS SDK
Performance
Reading and writing are dominated by pure-Rust work (XML parse/serialize,
deflate), with per-cell allocation kept off the hot paths. For a large sheet a
save is bounded mostly by the compression level; use CompressionLevel::None
when speed matters more than file size, or StreamingWorkbook when memory does.
License
MIT. See LICENSE.