umya-spreadsheet

Description
umya-spreadsheet is a library written in pure Rust to read and write xlsx file.
Chatting
The chat will be closed.
(Maybe I didn't set it up right, but it's because I no longer get notifications when new messages come in and I don't notice them anymore.)
Please mention in issues if you have any questions.
Update details
ver 2.3.2
Bug Fixed #290,#291
Usage
Installation
Add the following code to Cargo.toml
[]
= "2.3.3"
# WebAssembly support
= { = "2.3.3", = ["js"] }
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;
Read Value
let mut book = new_file;
book.get_sheet_by_name.unwrap.get_cell.get_value;
book.get_sheet_by_name.unwrap.get_cell.get_value;
book.get_sheet_by_name.unwrap.get_cell.get_value;
book.get_sheet_mut.unwrap.get_cell.get_value;
Change Value
let mut book = new_file;
book.get_sheet_by_name_mut.unwrap.get_cell_mut.set_value;
book.get_sheet_mut.unwrap.get_cell_mut.set_value;
Move Values
let range = "A1:A3";
let row = 10;
let column = 2;
book.get_sheet_by_name_mut.unwrap.move_range;
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;
Struct
Pass the book as a Spreadsheet to modify it in other functions.
let mut book = new_file;
let _ = book.new_sheet;
update_excel;
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
Contributing
Contributions by way of pull requests are welcome! Please make sure your code uses:
cargo fmtfor formatting- clippy