Skip to content

pblazh/tabula

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

278 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stand With Ukraine

Tabula Tabula - Spreadsheet-Inspired CSV Transformation

Tabula: save a CSV, formulas recompute in place

Transform CSV files using familiar spreadsheet formulas from the command line.

🎯 What is Tabula?

Tabula is a command-line tool that brings the power of spreadsheet calculations to CSV file processing.

πŸ’‘ Why Tabula?

Own Your Data

Your data should be yours - not locked in proprietary formats or cloud services:

  • πŸ“ Store anywhere - Local files, git repos, network drives, your choice
  • πŸ” Share when you want - No forced cloud sync or account requirements
  • πŸ“ Plain text - CSV files are readable, editable, and future-proof
  • πŸ” Use any tool - Works with grep, sed, awk, and all text utilities
  • πŸ“Š Universal format - Open in Excel, Google Sheets, databases, or any CSV-compatible tool

No Bloated Software

Why install a multi-gigabyte office suite when you only need basic calculations?

  • πŸͺΆ Tiny footprint - Single < 5MB binary, no installers, no dependencies
  • πŸš€ Fast - Processes large files efficiently from the command line
  • 🌍 Cross-platform - macOS, Linux, Windows - works everywhere
  • πŸ’» Scriptable - Integrates with shell scripts, CI/CD, and automation tools

Version Control Everything

Both your data AND transformations are text files:

  • βœ… Git-friendly - Track changes to CSV data and .tbl scripts
  • βœ… Diff & merge - See exactly what changed in your data
  • βœ… Collaborate - Share scripts and data through version control
  • βœ… Reproducible - Exact same results every time you run a script
  • βœ… Documented - Scripts serve as documentation for your transformations

Familiar & Powerful

  • πŸ“Š Spreadsheet syntax - Cell references (A1, B2), functions SUM, IF, etc
  • πŸ”’ Rich function library - 50+ built-in functions for numbers, text, dates, logic
  • 🎯 Purpose-built - Designed specifically for CSV transformation, not generic programming

πŸš€ Quick Start

Installation

Download the binary for your system:

https://pblazh.github.io/tabula/

Or build from source

Hello World

Input CSV (sales.csv):

Product , Price , Quantity
Apple   , 1.20  , 10
Cherry  , 2.50  , 8
Banana  , 0.80  , 15

Or user markdown as an input and output

| Product | Price | Quantity |
| ------- | ----- | -------- |
| Apple   | 1.20  | 10       |
| Cherry  | 2.50  | 8        |
| Banana  | 0.80  | 15       |

Script (script.tbl):

// Add header for total column
let D1 = "Total";

// Calculate total for each row
let D2:D4 = REF(REL(-2,0)) * REF(REL(-1,0));

// Add a grand total row
let A5 = "TOTAL";
let D5 = SUM(D2:D4);

Run:

tabula -a -s script.tbl -i sales.csv

Output:

Product , Price , Quantity , Total
Apple   , 1.20  , 10       , 12
Cherry  , 2.50  , 8        , 20
Banana  , 0.80  , 15       , 12
TOTAL   ,       ,          , 44

πŸ› οΈ Real-World Benefits

Work with Standard Tools

# Use grep to find rows
grep "Alice" data.csv | tabula -s transform.tbl

# Pipe through standard Unix tools
# calculate sales and output sorted by total
head -n1 sales.csv ; tabula -s script.tbl -i sales.csv | tail -n +2 | sort -t, -k3 -nr

# Combine with git
git diff data.csv  # See exactly what changed
git log transform.tbl  # Track transformation history
# etc

Share & Publish Freely

Your CSV output works everywhere:

  • πŸ“Š Import into Excel, Google Sheets, Numbers, etc
  • πŸ—„οΈ Load into databases (PostgreSQL, MySQL, SQLite, etc)
  • πŸ“ˆ Visualize with Tableau, Power BI, R, Python, etc
  • 🌐 Publish to GitHub, static sites, or data portals
  • πŸ“§ Email as attachments without format issues

No Lock-in

  • βœ… Data is yours - readable in any text editor
  • βœ… Scripts are portable - run anywhere
  • βœ… No subscriptions, no accounts, no cloud requirements
  • βœ… Works offline - no internet needed
  • βœ… Free & open source - use without restrictions

πŸ“š Documentation

For complete documentation, see doc/README.md

πŸ”Œ Editor Plugins

  • Vim/Neovim - Auto-execution on save of markdown and csv files. Markdown code-block support for CSV and Tabula scripts. Syntax highlighting for *.tbl files.
  • Visual Studio Code - Auto-execution on save of markdown and csv files. Markdown code-block support for CSV and Tabula scripts. Syntax highlighting for *.tbl files.
  • Obsidian - Auto-execution on save of markdown files. Code-block support for CSV and Tabula scripts.
  • Web Storm - Auto-execution on save of markdown and csv files. Code-block support for CSV and Tabula scripts. Syntax highlighting for *.tbl files.

Links

License

GNU General Public License v3.0

Support

If you find this project useful, consider:

  • ⭐ Starring the GitHub repository
  • πŸ› Reporting issues or suggesting features
  • πŸ“– Contributing to the documentation