top | item 47153091

Show HN: I got tired of writing Pandas scripts just to JOIN two CSV files

2 points| debba | 4 days ago

Every few weeks I get 2-3 CSV files and need to run a quick JOIN or aggregation. The options are always the same: fire up pandas, import into SQLite by hand, or use some janky web tool.

So I built a plugin for Tabularis (my native DB GUI) that treats a folder of CSV files as a database. Drop your files in, every file becomes a table, column types are inferred automatically, and you get a full SQL editor.

No code. No imports. Just SQL.

Example: 3 CSV files (users, orders, products) → this query works immediately:

  SELECT
    u.name,
    u.country,
    COUNT(o.id)                        AS orders,
    ROUND(SUM(p.price * o.quantity), 2) AS total_spent
  FROM orders o
  JOIN users u ON o.user_id = u.id
  JOIN products p ON o.product_id = p.id
  GROUP BY u.id
  ORDER BY total_spent DESC
The plugin is ~250 lines of stdlib Python (zero dependencies). It works because Tabularis has an open plugin protocol — JSON-RPC over stdin/stdout — so any data source can be a database.

Plugin: https://github.com/debba/tabularis-csv-plugin Tabularis: https://github.com/debba/tabularis

discuss

order

No comments yet.