The Wayback Machine - https://web.archive.org/web/20191118133416/https://github.com/harelba/q
Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

q - Run SQL directly on CSV or TSV files
Python Other
  1. Python 99.1%
  2. Other 0.9%
Branch: master
Clone or download
harelba Merge pull request #196 from mbrukman/readme-images-to-code
Replace image code samples with text.
Latest commit 02821fe Jun 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin everything running on both versions, requires more consolidation and … Dec 11, 2018
dist Modified windows installation instructions for dockerized version Apr 8, 2017
doc Replace image code samples with text. Jan 6, 2019
examples Fix typo in some docs and script Dec 27, 2017
test handle python 3.7 deprecation warning for universal file mode Dec 21, 2018
.gitignore working versions with sqlitebck - Need to find new packaging solution Nov 20, 2017
.travis.yml
LICENSE Create LICENSE Aug 12, 2017
README.markdown Replace image code samples with text. Jan 6, 2019
build-deb-builder-container WIP Apr 6, 2017
build-rpm-builder-container WIP Apr 6, 2017
create-windows-setup-instructions Hotfix for windows installation, to workaround pyinstaller warning bug Mar 24, 2018
package-release WIP Apr 6, 2017
requirements.txt wip Dec 8, 2018

README.markdown

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, JOINs, 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.

Python API

A development branch for exposing q's capabilities as a Python module can be viewed here, along with examples of the alpha version of the API.
Existing functionality as a command-line tool will not be affected by this. Your input will be most appreciated.

Change log

Click here to see the change log.

Contact

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

Harel Ben-Attia, harelba@gmail.com, @harelba on Twitter

q on twitter: #qtextasdata

You can’t perform that action at this time.