Skip to content
/ sqltxt Public

A SQL-to-coreutils interpreter for text data munging, written in Python.

License

Notifications You must be signed in to change notification settings

shahin/sqltxt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqltxt Build Status

A SQL-to-coreutils interpreter for text data munging, written in Python.

Overview

sqltxt will parse a (very limited) subset of SQL and translate it into functionally equivalent coreutils and awk calls.

Requirements

  • Python 2.7
  • GNU coreutils (to run the interpreted output)
  • awk

Install

git clone https://github.com/shahin/sqltxt.git
cd sqltxt
pip install -e.

Examples

Fast random sample from a large file

Print the last few lines (but keep the header)

Count categories

Join multiple data sources

# sqltxt "
select
  table_a.col_a,
  table_b.col_z
from
  tests/data/table_a.txt table_a
  join tests/data/table_b.txt table_b on (table_a.col_a = table_b.col_a)
where
  table_b.col_z = 'w'
"| bash
col_a,col_z
1,w
2,x
2,y

See more examples in the functional tests.

About

A SQL-to-coreutils interpreter for text data munging, written in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages