calamine
A Excel file reader, in pure Rust.
Description
calamine is a pure Rust library to read any excel file (xls
, xlsx
, xlsm
, xlsb
).
As long as your files are simple enough, this library should just work. For anything else, please file an issue with a failing test or send a pull request!
Examples
Simple
let mut excel = open.unwrap;
let r = excel.worksheet_range.unwrap;
for row in r.rows
More complex
use ;
// opens a new workbook
let path = "/path/to/my/excel/file.xlsm";
let mut workbook = open.unwrap;
// Read whole worksheet data and provide some statistics
if let Ok = workbook.worksheet_range
// Check if the workbook has a vba project
if workbook.has_vba
Others
Browse the examples directory.
Performance
While there is no official benchmark yet, my first tests show a significant boost compared to official C# libraries:
- Reading cell values: at least 3 times faster
- Reading vba code: calamine does not read all sheets when opening your workbook, this is not fair
Unsupported
Many (most) part of the specifications are not implemented, the focus has been put on reading cell values and vba code.
The main unsupported items are:
- no support for writing excel files, this is a read-only libray
- no support for reading extra contents, such as formatting, excel parameter, encrypted components etc ...
Credits
Thanks to xlsx-js developpers! This library is by far the simplest open source implementation I could find and helps making sense out of official documentation.
License
MIT