tsorg.py - org-mode to termsql
Converting org-mode tables to SQL-queryable formats.
I tend to work a lot in the console, and with org-mode. The latter is this wonderful contraption encompassing the ability to organize notes, execute code & do some spreadsheet calculations. Pretty priceless for a terminal dweller who’s an emacs user.
Thing is, org-mode doesn’t (yet) have any SQL support built in for its pesky tables. So, unless you want to export your table to .tsv or the like, and then import in mysql/postgresql/sqlite in order to perform any nontrivial queries, a shortcut really comes in handy.
Enter tsorg.py.
That little buddy takes in an org-mode table on the stdin, and outputs something that’s parseable by termsql, which, if you don’t know what it is, is one of the several tools that allow a user to quickly import a text (csv,tsv..) file into an sqlite engine and run queries against it.
Enjoy!