excelstream
🦀 High-performance streaming Excel, CSV & Parquet library for Rust with constant memory usage
✨ Highlights
- 📊 XLSX, CSV & Parquet Support - Read/write Excel, CSV, and Parquet files
- 📉 Constant Memory - ~3-35 MB regardless of file size
- ☁️ Cloud Streaming - Direct S3/GCS uploads with ZERO temp files
- ⚡ High Performance - 94K rows/sec (S3), 1.2M rows/sec (CSV)
- 🔄 True Streaming - Process files row-by-row, no buffering
- 🗜️ Parquet Conversion - Stream Excel ↔ Parquet with constant memory
- 🐳 Production Ready - Works in 256 MB containers
🔥 What's New in v0.15.0
Parquet Support - Stream Excel ↔ Parquet with constant memory!
use ;
// Excel → Parquet (10K rows at a time, constant memory)
let converter = new?;
converter.convert_to_parquet?;
// Parquet → Excel (streaming)
let converter = new?;
converter.convert_to_excel?;
Features:
- ✅ Streaming conversion - Constant memory (10K row batches)
- ✅ All data types - Strings, numbers, booleans, dates
- ✅ High performance - Process millions of rows efficiently
- ✅ Progress callbacks - Track conversion progress
See full changelog | Parquet examples →
📦 Quick Start
Installation
[]
= "0.15"
# Optional features
= { = "0.15", = ["cloud-s3"] } # S3 support
= { = "0.15", = ["cloud-gcs"] } # GCS support
= { = "0.15", = ["parquet-support"] } # Parquet conversion
Write Excel (Local)
use ExcelWriter;
let mut writer = new?;
// Write 1M rows with only 3 MB memory!
writer.write_header_bold?;
for i in 1..=1_000_000
writer.save?;
Read Excel (Streaming)
use ExcelReader;
let mut reader = open?;
// Process 1 GB file with only 12 MB memory!
for row in reader.rows?
S3 Streaming (v0.14+)
use S3ExcelWriter;
async
🎯 Why ExcelStream?
The Problem: Traditional libraries load entire files into memory
// ❌ Traditional: 1 GB file = 1+ GB RAM (OOM in containers!)
let workbook = new?;
The Solution: True streaming with constant memory
// ✅ ExcelStream: 1 GB file = 12 MB RAM
let mut reader = open?;
for row in reader.rows?
Performance Comparison
| Operation | Traditional | ExcelStream | Improvement |
|---|---|---|---|
| Write 1M rows | 100+ MB | 2.7 MB | 97% less memory |
| Read 1GB file | ❌ Crash | 12 MB | Works! |
| S3 upload 500K rows | Temp file | 34 MB | Zero disk |
| K8s pod (256MB) | ❌ OOMKilled | ✅ Works | Production ready |
☁️ Cloud Features
S3 Direct Streaming (v0.14)
Upload Excel files directly to S3 with ZERO temp files:
Performance (Real AWS S3):
| Dataset | Memory | Throughput | Temp Files |
|---|---|---|---|
| 10K rows | 15 MB | 11K rows/s | ZERO ✅ |
| 100K rows | 23 MB | 45K rows/s | ZERO ✅ |
| 500K rows | 34 MB | 94K rows/s | ZERO ✅ |
Perfect for:
- ✅ AWS Lambda (read-only filesystem)
- ✅ Docker containers (no disk space)
- ✅ Kubernetes CronJobs (limited memory)
GCS Direct Streaming (v0.14)
Upload Excel files directly to Google Cloud Storage with ZERO temp files:
use GCSExcelWriter;
async
Perfect for:
- ✅ Cloud Run (read-only filesystem)
- ✅ Cloud Functions (no disk space)
- ✅ GKE workloads (limited memory)
HTTP Streaming
Stream Excel files directly to web responses:
use HttpExcelWriter;
async
📊 CSV Support
13.5x faster than Excel for CSV workloads:
use CsvWriter;
let mut writer = new?;
writer.write_row?; // 1.2M rows/sec!
writer.save?;
Features:
- ✅ Zstd compression (
.csv.zst- 2.9x smaller) - ✅ Auto-detection (
.csv,.csv.gz,.csv.zst) - ✅ Streaming (< 5 MB memory)
🗜️ Parquet Support (v0.15+)
Convert between Excel and Parquet with constant memory streaming:
Excel → Parquet
use ExcelToParquetConverter;
let converter = new?;
let rows = converter.convert_to_parquet?;
println!;
Parquet → Excel
use ParquetToExcelConverter;
let converter = new?;
let rows = converter.convert_to_excel?;
println!;
Streaming with Progress
let converter = new?;
converter.convert_with_progress?;
Features:
- ✅ Constant memory - Processes in 10K row batches
- ✅ All data types - Strings, numbers, booleans, dates, timestamps
- ✅ Progress tracking - Monitor large conversions
- ✅ High performance - Efficient columnar format handling
Use Cases:
- Convert Excel reports to Parquet for data lakes
- Export Parquet data to Excel for analysis
- Integrate with Apache Arrow/Spark workflows
🚀 Use Cases
1. Large File Processing
// Process 500 MB Excel with only 25 MB RAM
let mut reader = open?;
for row in reader.rows?
2. Database Exports
// Export 1M database rows to Excel
let mut writer = new?;
let rows = db.query?;
for row in rows
writer.save?; // Only 3 MB memory used!
3. Cloud Pipelines
// Lambda function: DB → Excel → S3
let mut writer = builder
.bucket.key.build.await?;
let rows = db.query_stream.await?;
while let Some = rows.next.await
writer.save.await?; // No temp files, no disk!
📚 Documentation
- API Docs - Full API reference
- Examples - Code examples for all features
- CHANGELOG - Version history
- Performance - Detailed benchmarks
Key Topics
- Excel Writing - Basic & advanced writing
- Excel Reading - Streaming read
- S3 Streaming - AWS S3 uploads
- GCS Streaming - Google Cloud Storage uploads
- CSV Support - CSV operations
- Parquet Conversion - Excel ↔ Parquet
- Styling - Cell formatting & colors
🔧 Features
| Feature | Description |
|---|---|
default |
Core Excel/CSV with Zstd compression |
cloud-s3 |
S3 direct streaming (async) |
cloud-gcs |
GCS direct streaming (async) |
cloud-http |
HTTP response streaming |
parquet-support |
Parquet ↔ Excel conversion |
serde |
Serde serialization support |
parallel |
Parallel processing with Rayon |
⚡ Performance
Memory Usage (Constant):
- Excel write: 2.7 MB (any size)
- Excel read: 10-12 MB (any size)
- S3 streaming: 30-35 MB (any size)
- CSV write: < 5 MB (any size)
Throughput:
- Excel write: 42K rows/sec
- Excel read: 50K rows/sec
- S3 streaming: 94K rows/sec
- CSV write: 1.2M rows/sec
🛠️ Migration from v0.13
S3ExcelWriter is now async:
// OLD (v0.13 - sync)
writer.write_row?;
// NEW (v0.14 - async)
writer.write_row.await?;
All other APIs unchanged!
📋 Requirements
- Rust 1.70+
- Optional: AWS credentials for S3 features
🤝 Contributing
Contributions welcome! Please read CONTRIBUTING.md.
📄 License
MIT License - See LICENSE for details
🙏 Credits
- Built with s-zip for streaming ZIP
- AWS SDK for Rust
- All contributors and users!
Need help? Open an issue | Questions? Discussions