Thanks to visit codestin.com
Credit goes to lib.rs

#excel #reader #biff8

xlrd

A historical Excel BIFF8 xls format file reader in pure Rust

2 releases

Uses new Rust 2024

0.1.1 Oct 11, 2025
0.1.0 Sep 24, 2025

#1273 in Encoding

MIT license

86KB
2.5K SLoC

xlrd

A Rust port of Python's xlrd ?

The library is a pure Rust library used for reading data and formatting information from Excel files in the historical .xls BIFF8 format.

It focuses solely on reading basic data and formatting information, and store them in the umya-spreadsheet::Spreadsheet structure, so you can easily modify and save it as .xlsx.

Unsupported Features

  • Password-protected files
  • Embedded Objects (Chars, Macros, Pictures, Worksheets etc.)
  • Formulas
  • VBA modules
  • Comments
  • Hyperlinks
  • Autofilters, advanced filters, pivot tables, conditional formatting, data validation

Install

Run the following Cargo command in your project directory:

cargo add xlrd

# If need to view the reading process
cargo add xlrd --features tracing

# When need to modify the data or formatting, may also need to add
cargo add umya-spreadsheet

Or add the following line to your Cargo.toml:

xlrd = "0.1.0"

# If need to view the reading process
xlrd = { version = "0.1.0", features = ["tracing"] }

# When need to modify the data or formatting, may also need to add
umya-spreadsheet = "2"

Example

It's very simple, xlrd has only 3 functions:

  • xlrd::open
  • xlrd::save
  • xlrd::xls2xlsx
// Only just when enable the `tracing` feature
tracing_subscriber::fmt::init();

let mut workbook = xlrd::open("path/from/your/file.xls").unwrap();

// After modify the data or formating...
xlrd::save(&workbook, "path/to/your/file.xlsx").unwrap();

// Or just convert to `.xlsx`, automatically save to the origin directory
let xlsx_path = xlrd::xls2xlsx("path/from/your/file.xls").unwrap();

Reference

License

MIT

Dependencies

~34MB
~533K SLoC