talira

rust_xlsxwriter

A Rust library for creating Excel XLSX files.

open sourceMIT OR Apache-2.0self-hostablefree

rust_xlsxwriter writes new Excel .xlsx files from Rust: text, numbers, dates and formulas (including Excel 365 dynamic functions) with full cell formatting, charts, images, tables, pivot tables, conditional formatting, data validation, sparklines, notes, checkboxes, autofilters, page setup and macros. John McNamara wrote it as a Rust rewrite of his Python XlsxWriter library, with a focus on matching the files Excel itself creates and on speed, plus a constant-memory mode for large files. Optional features add Serde serialization, Polars error mapping (used by polars_excel_writer) and WebAssembly builds. It can't read or modify an existing file: umya-spreadsheet does read-modify-write.

Problems it solves

  • export a report from my Rust service as a real Excel file with formatting, not CSV
  • generate an xlsx with bold headers, number formats, merged cells and column widths in Rust
  • add native Excel charts to a spreadsheet my Rust program creates
  • write millions of rows to an Excel file without running out of memory
  • serialize a Vec of Rust structs straight into a worksheet
  • write a Polars DataFrame to a formatted Excel file
  • add data validation dropdowns and conditional formatting to a generated workbook
  • create Excel tables and pivot tables from code
  • generate Excel files from Rust compiled to WebAssembly in the browser
  • write formulas that use dynamic array functions like FILTER and UNIQUE into an xlsx

Features

  • all basic Excel data types and full cell formatting
  • formulas, including Excel 365 dynamic functions
  • charts, sparklines, images, textboxes and checkboxes
  • worksheet tables, pivot tables, autofilters and defined names
  • conditional formatting and data validation
  • merged ranges, outline groupings, rich multi-format strings and cell notes
  • page and printing setup, workbook themes and macros
  • constant memory mode for writing large files
  • serde feature to serialize structs to worksheets
  • polars and wasm features

Limitations

  • Doesn't read or modify existing Excel files: it only writes new .xlsx files1

Capabilities

Has official SDKsplan not known

Alternatives

The same job

These do what rust_xlsxwriter does.

  1. umya-spreadsheet A pure rust library for reading and writing spreadsheet files

Compare rust_xlsxwriter with the top 3