sheets — A high-performance C-backed CSV engine for Lua

92 views
Skip to first unread message

Shivam Sharma

unread,
Jul 4, 2026, 9:27:56 AM (8 days ago) Jul 4
to lua-l
Hello Lua community,

I'm excited to share Sheets, a high-performance CSV library for Lua built with the goal of bringing modern, production-grade data tooling to the Lua ecosystem.

Lua is one of the most elegant languages I've worked with: minimal, fast, embeddable, and extremely flexible. However, I have often felt that the ecosystem lacks robust tooling in areas like data processing, analytics, and modern developer workflows.

Sheets is my first step toward helping improve that.

Unlike pure-Lua CSV parsers, Sheets uses a hybrid architecture:
- C backend powered by libcsv for fast parsing and writing
- Clean Lua API inspired by Python's csv module
- Cross-platform support via LuaRocks

==================================================
KEY FEATURES
==================================================

- High-performance CSV parsing using libcsv
- Python-style API:
    * reader
    * writer
    * DictReader
    * DictWriter

- CSV dialect support:
    * Excel
    * Excel-Tab
    * Unix
    * Custom dialects

- CSV Sniffer (delimiter detection)

- Utility functions:
    * read_csv
    * write_csv
    * parse
    * filter
    * sort
    * group_by
    * transpose
    * column extraction

- Cross-platform support

==================================================
COMPARISON WITH PYTHON CSV MODULE
==================================================

Python:

    import csv

    with open("data.csv") as f:
        reader = csv.reader(f)
        for row in reader:
            print(row)

Lua (Sheets):

    local sheets = require("sheets")

    local f = io.open("data.csv")
    for row in sheets.reader(f) do
        print(row[1], row[2])
    end
    f:close()

Dict-based reading:

    for rec in sheets.DictReader(io.open("data.csv")) do
        print(rec.name, rec.age)
    end

==================================================
INSTALLATION
==================================================

    luarocks install sheets

==================================================
PROJECT LINKS
==================================================

GitHub Repository:

LuaRocks Package:

Documentation Website:

==================================================
TESTED ON
==================================================

- Windows
- Linux (WSL / native)
- Termux (Android)

==================================================
VISION
==================================================

This is only the beginning.

My broader goal is to help build serious tooling for Lua in areas such as:
- data processing
- analytics
- numerical computing
- machine learning infrastructure

I believe Lua has tremendous potential beyond scripting and embedding, and I hope projects like this can help strengthen the ecosystem.

I would greatly appreciate feedback, suggestions, bug reports, or contributions from the community.

Thank you.

Best regards,
Shivam Sharma

GitHub:

Thijs Schreijer

unread,
Jul 4, 2026, 1:14:47 PM (8 days ago) Jul 4
to lu...@googlegroups.com

On Sat, 4 Jul 2026, at 15:22, Shivam Sharma wrote:
Hello Lua community,

I'm excited to share Sheets, a high-performance CSV library for Lua built with the goal of bringing modern, production-grade data tooling to the Lua ecosystem.

Nice! I don't have a lot of csv parsing to do these days, but will definitely keep this one in mind for my next csv adventure.

Thijs

Marc Balmer

unread,
Jul 4, 2026, 1:16:15 PM (8 days ago) Jul 4
to lu...@googlegroups.com, lu...@googlegroups.com
Also, csv is a bit boring. Why not go for the open document format?

Am 04.07.2026 um 19:14 schrieb 'Thijs Schreijer' via lua-l <lu...@googlegroups.com>:


--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lua-l/e704aa41-c7f5-47f4-b847-2e6269f00e36%40app.fastmail.com.

Martin Eden

unread,
Jul 4, 2026, 11:43:31 PM (7 days ago) Jul 4
to lu...@googlegroups.com
On 2026-07-04 19:16, Marc Balmer wrote:
> Also, csv is a bit boring. Why not go for the open document format?
CSV is real-world.

I remember writing CSV parser in Lua like ten years ago.
Input was 700 MB .csv from library Genesis.

I think OP will discover how dirty real data can be (wrong quoting
and different format flavors instead of one standard). And how hairy
processing code becomes of this.

And I won't dare to do it in ancient language without variable-length
structures like C.

-- Martin

Foster Schucker

unread,
Jul 5, 2026, 2:21:29 PM (7 days ago) Jul 5
to lu...@googlegroups.com
I worked with a 117,000 rows with all the employee data on a migration
from System A -> B.  A could only produce CSV and we spent a week
cleaning data.  I had an AWK hand written parser we used that did all
the changes.  The final AWK change once file was over 3K in AWK code
plus the parser.

Fun times??


Reply all
Reply to author
Forward
0 new messages