excel-rs 1.0.0

A fast, low-allocation Rust library for writing XLSX (Excel) files.
Documentation
  • Coverage
  • 76.67%
    23 out of 30 items documented2 out of 11 items with examples
  • Size
  • Source code size: 47.85 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.75 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 19s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • carlvoller/excel-rs
    17 4 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • carlvoller

excel-rs-xlsx

A fast, low-allocation Rust library for writing XLSX (Excel Open XML) files.

excel-rs-xlsx is the core engine behind py-excel-rs and cli-excel-rs. It streams cell data directly into a ZIP-compressed XLSX archive, flushing to the underlying writer in batches — it never materialises the full file in memory.

Features

  • Streams directly to any Write + Seek target (file, Cursor<Vec<u8>>, etc.)
  • SIMD-accelerated XML escaping via memchr
  • Compile-time column-letter lookup table (zero runtime allocation for A1 references)
  • Supports strings, numbers, booleans, and dates
  • Named worksheets
  • Row/column/sheet limit enforcement matching the OOXML spec

Usage

use std::fs::File;
use excel_rs::{WorkBook, sheet::CellType};

let file = File::create("output.xlsx")?;
let mut wb = WorkBook::new(file);

let mut sheet = wb.new_worksheet("Sales".to_string())?;

// Write a header row (all strings by default)
sheet.write_row([b"Name".as_ref(), b"Revenue"].into_iter(), None)?;

// Write a data row with explicit type hints
sheet.write_row(
    [b"Alice".as_ref(), b"42000"].into_iter(),
    Some(&[CellType::String, CellType::Number]),
)?;

sheet.close()?;
wb.finish()?;

Limits

Resource Maximum
Rows per worksheet 1 048 576
Columns per worksheet 16 384
Worksheets per workbook 65 535

License

MIT