#excel #spreadsheet #xlsx #reader #writer

umya-spreadsheet

umya-spreadsheet is a library written in pure Rust and read and write xlsx file

16 releases

Uses old Rust 2015

0.1.17-beta Oct 27, 2020
0.1.16-beta Oct 18, 2020
0.1.12-beta Sep 23, 2020
0.1.5-beta Aug 28, 2020

#31 in Windows APIs

Download history 34/week @ 2020-08-20 44/week @ 2020-08-27 72/week @ 2020-09-03 2/week @ 2020-09-10 19/week @ 2020-09-17 34/week @ 2020-09-24 58/week @ 2020-10-01 22/week @ 2020-10-08 46/week @ 2020-10-15 45/week @ 2020-10-22 18/week @ 2020-10-29 53/week @ 2020-11-05 26/week @ 2020-11-12 3/week @ 2020-11-19 21/week @ 2020-11-26

117 downloads per month

MIT license

405KB
10K SLoC

umya-spreadsheet

Crates.io Crates.io

Description

umya-spreadsheet is a library written in pure Rust and read and write xlsx file.

Caution

This is BETA version.

  • It contains many bugs.
  • Often changes are not backward compatible.

Example

Result Image

extern crate umya_spreadsheet;

// reader
let path = std::path::Path::new("C:/spread_test_data/aaa.xlsx");
let mut book = umya_spreadsheet::reader::xlsx::read(path).unwrap();
// or
// new file
let mut book = umya_spreadsheet::new_file();

// new worksheet
let _ = book.new_sheet("Sheet2");

// change value
let _ = book.get_sheet_by_name_mut("Sheet2").unwrap().get_cell_mut("A1").set_value("TEST1");
// or
let _ = book.get_sheet_mut(1).get_cell_by_column_and_row_mut(1, 1).set_value("TEST1");

// read value
let a1_value = book.get_sheet_by_name("Sheet2").unwrap().get_cell("A1").unwrap().get_value();
// or
let a1_value = book.get_sheet(1).unwrap().get_cell_by_column_and_row(1, 1).unwrap().get_value();
assert_eq!("TEST1", a1_value);  // TEST1

// add bottom border
let _ = book.get_sheet_by_name_mut("Sheet2").unwrap()
.get_style_mut("A1")
.get_borders_mut()
.get_bottom_mut()
.set_border_style(umya_spreadsheet::Border::BORDER_MEDIUM);
// or
let _ = book.get_sheet_by_name_mut("Sheet2").unwrap()
.get_style_by_column_and_row_mut(1, 1)
.get_borders_mut()
.get_bottom_mut()
.set_border_style(umya_spreadsheet::Border::BORDER_MEDIUM);

// writer
let path = std::path::Path::new("C:/spread_test_data/bbb.xlsx");
let _ = umya_spreadsheet::writer::xlsx::write(&book, path);

License

MIT

Dependencies

~3.5–5MB
~102K SLoC