Crate excelstream

Crate excelstream 

Source
Expand description

§excelstream

A high-performance Rust library for streaming Excel import/export operations.

§Features

  • Streaming Read: Read large Excel files without loading entire file into memory
  • Streaming Write: Write millions of rows with constant ~80MB memory usage
  • Formula Support: Write Excel formulas that calculate correctly
  • High Performance: 30K-45K rows/sec throughput with true streaming
  • Better Errors: Context-rich error messages with debugging info
  • Multiple Formats: Support for XLSX, XLS, ODS formats
  • Type Safety: Strong typing with Rust’s type system
  • Zero-copy: Minimize memory allocations where possible

§Quick Start

§Reading Excel Files (Streaming)

use excelstream::reader::ExcelReader;

let mut reader = ExcelReader::open("data.xlsx")?;

for row_result in reader.rows("Sheet1")? {
    let row = row_result?;
    println!("Row: {:?}", row);
}

§Writing Excel Files (Streaming)

use excelstream::writer::ExcelWriter;
use excelstream::types::CellValue;

let mut writer = ExcelWriter::new("output.xlsx")?;

// Write header
writer.write_header(&["Name", "Age", "City"])?;

// Write data rows with typed values
writer.write_row_typed(&[
    CellValue::String("Alice".to_string()),
    CellValue::Int(30),
    CellValue::String("New York".to_string()),
])?;

// Write with formulas
writer.write_row_typed(&[
    CellValue::String("Total".to_string()),
    CellValue::Formula("=COUNT(B2:B10)".to_string()),
    CellValue::Empty,
])?;

writer.save()?;

Re-exports§

pub use error::ExcelError;
pub use error::Result;
pub use reader::ExcelReader;
pub use types::Cell;
pub use types::CellStyle;
pub use types::CellValue;
pub use types::Row;
pub use types::StyledCell;
pub use writer::ExcelWriter;

Modules§

error
Error types for the rust-excelize library
fast_writer
Fast Excel writer optimized for streaming
reader
Excel file reading with streaming support
types
Type definitions for Excel data
writer
Excel file writing with TRUE streaming support