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.8.0
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.8"
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;
Wite file
let path = new;
let _ = write;
Wite 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