1 unstable release

Uses old Rust 2015

0.1.0 Dec 20, 2017

#8 in #ods

Download history 5/week @ 2024-01-08 7/week @ 2024-02-12 13/week @ 2024-02-19 18/week @ 2024-02-26 10/week @ 2024-03-04 11/week @ 2024-03-11 12/week @ 2024-03-18 9/week @ 2024-03-25 33/week @ 2024-04-01

67 downloads per month
Used in 2 crates

MIT/Apache

105KB
2K SLoC

Contains (Zip file, 9KB) data/test.xlsx

spsheet-rs

A xlsx or ods read and write library

Documentation

Description

spsheet-rs is is a pure Rust library to read and write any xlsx and ods file.

Features

  • xlsx Read
  • xlsx Write
  • ods Read
  • ods Write
  • Cell Value
  • Cell Date Format(partialy support)
  • Cell Digit Format
  • Cell Border
  • Cell Color
  • Cell Width
  • Cell Hegiht
  • Formular

Examples

extern crate spsheet;
use spsheet::ods;
use spsheet::xlsx;
use spsheet::{Book,Sheet,Cell};
use spsheet::style::Style;
use std::path::Path;

let mut book = Book::new();
let mut sheet = Sheet::new("シート1");
sheet.add_cell(Cell::str("a"), 0, 0);
sheet.add_cell(Cell::str("b"), 0, 1);
sheet.add_cell(Cell::float(1.0), 1, 0);
sheet.add_cell(Cell::float(2.0), 1, 1);
sheet.add_cell(Cell::date_with_style("2017-12-02", Style::new("MM\\月DD\\")), 2, 0);
sheet.add_cell(Cell::date_with_style("2017-12-02T13:30:00", Style::new("YYYY/MM/DD\\ HH:MM:SS")), 2, 1);
book.add_sheet(sheet);

let _ = ods::write(&book, Path::new("./tests/test.ods"));
let res = ods::read(Path::new("./tests/test.ods")).unwrap();
assert_eq!(book, res);

let _ = xlsx::write(&book, Path::new("./tests/test.xlsx"));
let res = xlsx::read(Path::new("./tests/test.xlsx")).unwrap();
assert_eq!(book, res);

If I can find Google Shreadsheet API Library in Rust, I'll support Google Shpeadsheet.

Dependencies

~2–4.5MB
~80K SLoC