umya-spreadsheet

Description
umya-spreadsheet is a library written in pure Rust and read and write xlsx file.
Chatting
Please use Gitter for brief chats.
New feature
ver 0.9.1
Changed file compression logic when writing. The file size is smaller than before, but the processing time is longer. If you want to use the previous logic, use this method.
write_light;
write_with_password_light;
ver 0.9
The way cells are referenced has changed.
// old
let value = worksheet.get_value;
let value = worksheet.get_value_by_column_and_row;
// This one has been deprecated.
// It will eventually disappear.
// NEW
let value = worksheet.get_value;
let value = worksheet.get_value;
let value = worksheet.get_value;
ver 0.8
A password can now be set when saving a file.
let path = new;
let _ = write_with_password;
let from_path = new;
let to_path = new;
let _ = set_password;
Usage
Installation
Add the following code to Cargo.toml
[]
= "0.9"
Add the following code to main.rs
extern crate umya_spreadsheet;
Read file
let path = new;
let mut book = read.unwrap;
Read file (Lazy)
Delays the loading of the worksheet until it is needed. When loading a file with a large amount of data, response improvement can be expected.
let path = new;
let mut book = lazy_read.unwrap;
New file
let mut book = new_file;
Write file
let path = new;
let _ = write;
Write file with password
let path = new;
let _ = write_with_password;
let from_path = new;
let to_path = new;
let _ = set_password;
Change Value
let mut book = new_file;
let _ = book.new_sheet;
book.get_sheet_by_name_mut.unwrap.get_cell_mut.set_value;
Change Style
let mut book = new_file;
let mut style = book.get_sheet_by_name_mut.unwrap.get_style_mut;
// fill color on red.
style.set_background_color;
New Chart
let mut book = new_file;
// Add Chart
let mut from_marker = default;
from_marker.set_coordinate;
let mut to_marker = default;
to_marker.set_coordinate;
let area_chart_series_list = vec!;
let mut chart = default;
chart.new_chart;
book.get_sheet_by_name_mut.unwrap
.add_chart;
See the next chapter for implementation status and more detailed usage.
Support Status
| Function | detail | example |
|---|---|---|
| file reader | xlsx, xlsm | here. |
| file lazy_reader | xlsx, xlsm | here. |
| file writer | xlsx, xlsm | here. |
| csv | here. | |
| file writer with password | xlsx, xlsm | here. |
| worksheet | read, new, copy | here. |
| cell value | read, edit, formated value. | here. |
| cell style | read, edit | here. |
| columns | read, edit, auto width | here. |
| rows | read, edit | |
| charts | read, edit | here. |
| drawings | read, edit(Still might be inconvenient.) | |
| images | read, edit | here. |
| ole objects | read, edit(Still might be inconvenient.) |
License
MIT