Skip to main content

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 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::streaming_reader::StreamingReader;

let mut reader = StreamingReader::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 streaming_reader::StreamingReader as ExcelReader;
pub use types::Cell;
pub use types::CellStyle;
pub use types::CellValue;
pub use types::ProtectionOptions;
pub use types::Row;
pub use types::StyledCell;
pub use writer::ExcelWriter;
pub use csv_reader::CsvReader;
pub use csv_writer::CsvWriter;
pub use http_csv_writer::HttpCsvWriter;

Modules§

append
Incremental append mode for Excel files
csv
CSV utilities for encoding and parsing
csv_reader
CSV file reading with streaming support and decompression
csv_writer
CSV file writing with streaming support and compression
error
Error types for the rust-excelize library
fast_writer
Fast Excel writer optimized for streaming
http_csv_writer
HTTP streaming CSV writer
streaming_reader
Streaming reader for XLSX files with optimized memory usage
types
Type definitions for Excel data
writer
Excel file writing with streaming support

Enums§

CompressionMethod
Compression method to use for ZIP entries