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.
Version 3.0.0 has been released
This update contains breaking changes. Please refer to this page when upgrading from version 2.x to 3.x. https://github.com/MathNya/umya-spreadsheet/blob/master/CHANGELOG.md
Usage
Installation
Add the following code to Cargo.toml
[]
= "3.0.0"
# WebAssembly support
= { = "3.0.0", = ["js"] }
# Use only png for image processing
= { = "3.0.0", = ["image/png"] }
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 _unused = write;
Write file with password
let path = new;
let _unused = write_with_password;
let from_path = new;
let to_path = new;
let _unused = set_password;
Read Value
let mut book = new_file;
book.sheet_by_name.unwrap.cell.value;
book.sheet_by_name.unwrap.cell.value;
book.sheet_by_name.unwrap.cell.value;
book.sheet_mut.unwrap.cell.value;
Change Value
let mut book = new_file;
book.sheet_by_name_mut.unwrap.cell_mut.set_value;
book.sheet_mut.unwrap.cell_mut.set_value;
Move Values
let range = "A1:A3";
let row = 10;
let column = 2;
book.sheet_by_name_mut.unwrap.move_range;
Change Style
let mut book = new_file;
let mut style = book.sheet_by_name_mut.unwrap.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.sheet_by_name_mut.unwrap
.add_chart;
Struct
Pass the book as a Workbook to modify it in other functions.
let mut book = new_file;
let _unused = 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
cargo +nightly fmt --all
cargo clippy -- -D warnings
Acknowledgements
These are the people who have supported the umya-spreadsheet project. We would like to express our heartfelt gratitude to them.
8191, agentjill, attila-lin, boseongkim32, c-git, cstkingkey, DaimoniX, developer0hye, fabianboesiger, ggodlewski, gitter-badger, hackers267, iancormac84, jimchan3301, jmbrunskill, john-dc252, kazuk, kjh618, KyGost, lanej, matt-duch, mxsrm, nikvoid, oxabz, patrickomatic, piaoger, popen2, PSU3D0, RoloEdits, SamuelMarks, schungx, sjfhsjfh, tomgroenwoldt, tzfun, ubamrein, usagi, vonkruel, WilliamTCarroll, wolfiesch, xamgore, yerlibilgin, zjhsd2007
Projects using umya-spreadsheet
Community projects built with umya-spreadsheet (not endorsements).
- spreadsheet-mcp - MCP server for spreadsheet analysis/editing (xlsx/xlsm via
umya-spreadsheet) - formualizer - Arrow-backed spreadsheet engine and formula parser with excel parity (xlsx/xlsm via
umya-spreadsheet)