datacell
A fast, unified CLI tool for spreadsheet and columnar data manipulation.
Features
- Multi-format support: CSV, XLSX, XLS, ODS, Parquet, Avro
- Excel-like formulas: SUM, AVERAGE, VLOOKUP, IF, and more
- Data operations: sort, filter, dedupe, transpose, join, groupby
- Convert between formats: One command for any format conversion
- Output options: CSV, JSON, Markdown
- MCP server: For AI assistant integration
Installation
# Homebrew (macOS/Linux)
# From source
# Using cargo
Quick Start
# Convert formats
# Apply formula
# Filter and sort
# Output as JSON
Common Commands
Read & Write
# Read any format
# Read with format conversion
# Write to any format
Convert Formats
Data Operations
# Sort
# Filter
# Remove duplicates
# Transpose
# Find and replace
Pandas-Style Operations
# First/last rows
# Select columns
# Summary statistics
# Group and aggregate
# Join files
# Fill/drop missing values
Formula Reference
| Formula | Description |
|---|---|
SUM(A1:A10) |
Sum of range |
AVERAGE(A1:A10) |
Average of range |
MIN(A1:A10) / MAX(A1:A10) |
Min/Max values |
COUNT(A1:A10) |
Count of cells |
IF(A1>10, "High", "Low") |
Conditional logic |
VLOOKUP(2, A1:C10, 3) |
Lookup value |
CONCAT(A1, " ", B1) |
String concatenation |
ROUND(A1, 2) |
Round to decimals |
ABS(A1) |
Absolute value |
LEN(A1) |
Text length |
Shell Completions
Configuration
Generate a config file with default options:
Example .datacell.toml:
[]
= true
= "4472C4"
= true
= true
[]
= "csv"
= true
Custom XLSX Writer
datacell generates Excel files using a from-scratch XLSX writer — no external Excel writing library needed. The writer produces Office Open XML (OOXML) files directly as ZIP archives containing XML, validated against the ECMA-376 standard.
Why Build From Scratch?
We tried several existing Rust crates for XLSX writing and ran into issues:
| Approach | Issue |
|---|---|
rust_xlsxwriter |
Worked well initially, but added a heavy dependency tree and had version compatibility friction with the zip crate |
simple_excel_writer |
Limited feature set, no formula support |
xlsxwriter (C bindings) |
Requires system-level C library, complicates cross-compilation |
Building our own writer using just the zip crate gave us full control over the XML output, a smaller dependency footprint, and the ability to fix compatibility issues directly. The trade-off is that advanced features (charts, conditional formatting) require implementing complex XML markup ourselves.
What It Supports
- Multiple sheets with name validation
- Cell types: String, Number, Formula, Empty
- Column widths (auto-fit and manual)
- Freeze headers (frozen top row)
- Auto-filter for table columns
- Basic styling (bold headers, alignment, borders, fills)
- Proper OOXML structure — opens in Excel, Numbers, LibreOffice, Google Sheets
Usage
# Convert CSV to XLSX
# Export with styled headers, freeze panes, and auto-filter
# Write formulas to XLSX
// Programmatic usage
use ;
let mut writer = new;
writer.add_sheet?;
let mut header = new;
header.add_string;
header.add_string;
writer.add_row;
let mut row = new;
row.add_string;
row.add_number;
writer.add_row;
let file = create?;
writer.save?;
Current Limitations
- Charts — not yet implemented (requires complex XML drawing/chart markup)
- Sparklines — not yet implemented
- Conditional formatting — not yet implemented (color scales, data bars, icon sets)
- Merged cells — not yet implemented
- Rich text within cells — not supported
For charts and visualizations, consider exporting to CSV and using dedicated plotting tools (e.g., Python matplotlib, gnuplot).
MCP Server
Start the MCP server for AI assistant integration: