A pure Rust Excel/OpenDocument SpreadSheets file reader: rust on metal sheets
open sourceMITself-hostablefree
calamine is a pure Rust library that reads and deserializes spreadsheets: Excel .xls, .xlsx, .xlsm, .xlsb, .xla and .xlam, and OpenDocument .ods. It returns cell ranges you can iterate or deserialize into Rust types with Serde, reads formulas, defined names and VBA project code, and with the picture feature the raw data of pictures; xlsx and xlsb workbooks load sheets lazily. It reads XLSX cell styles, but most of the file formats' specifications aren't implemented: the focus is cell values and VBA. It's read-only, so programs that must save a workbook pair it with a writer such as rust_xlsxwriter or use umya-spreadsheet.
Problems it solves
- read rows from an uploaded Excel file into Rust structs
- parse old .xls files as well as .xlsx in a Rust program
- import data from OpenDocument .ods spreadsheets in Rust
- read values from a binary .xlsb workbook without Excel
- extract the VBA macro code from an Excel file to inspect it
- list the formulas in each worksheet of a workbook from code
- read a large spreadsheet quickly without loading every sheet
- deserialize a column that mixes numbers and text without failing on bad cells
- pull the pictures embedded in a spreadsheet out as raw bytes
Features
- reads xls, xlsx, xlsm, xlsb, xla, xlam and ods
- Serde deserialization of ranges, with helpers for invalid values
- header row handling and range iteration
- formulas and defined names
- VBA project modules and references
- XLSX cell styles via worksheet_style()
- lazy sheet loading for xlsx and xlsb
- optional chrono and picture features
Limitations
- Doesn't write or save spreadsheets: it's a read-only library1
- Doesn't read cell formatting beyond XLSX cell styles: other formats' formatting and encrypted parts aren't supported1
Capabilities
| Has official SDKs | plan not known |
|---|
Alternatives
The same job
These do what calamine does.
- umya-spreadsheet A pure rust library for reading and writing spreadsheet files
