Need help with q?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

harelba
7.9K Stars 348 Forks GNU General Public License v3.0 360 Commits 76 Opened issues

Description

q - Run SQL directly on CSV or TSV files

Services available

!
?

Need anything else?

Contributors list

Build Status

q - Text as Data

q is a command line tool that allows direct execution of SQL-like queries on CSVs/TSVs (and any other tabular text files).

q treats ordinary files as database tables, and supports all SQL constructs, such as

WHERE
,
GROUP BY
,
JOIN
s, etc. It supports automatic column name and type detection, and q provides full support for multiple character encodings.

q's web site is http://harelba.github.io/q/. It contains everything you need to download and use q immediately.

Installation.

Extremely simple.

Instructions for all OSs are here.

Examples

q "SELECT COUNT(*) FROM ./clicks_file.csv WHERE c3 > 32.3"

ps -ef | q -H "SELECT UID, COUNT(*) cnt FROM - GROUP BY UID ORDER BY cnt DESC LIMIT 3"

Go here for more examples.

Benchmark

I have created a preliminary benchmark comparing q's speed between python2, python3, and comparing both to textql and octosql.

Your input about the validity of the benchmark and about the results would be greatly appreciated. More details are here.

Contact

Any feedback/suggestions/complaints regarding this tool would be much appreciated. Contributions are most welcome as well, of course.

Linkedin: Harel Ben Attia

Twitter @harelba

Email [email protected]

q on twitter: #qtextasdata

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.