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 column type detection, and provides full support for multiple encodings. q fully supports all types of encoding. Use -e data-encoding to set the input data encoding, -Q query-encoding to set the query encoding, and use -E output-encoding to set the output encoding. Sensible defaults are in place for all three parameters. Files with BOM: Files which contain a BOM (Byte Order Mark) are not properly supported inside python's csv module. q contains a workaround that allows reading UTF8 files which contain a BOM - Use -e utf-8-sig for this. The plan is to separate the BOM handling from the encoding itself, which would allow to support BOMs for all encodings.

Features

  • q allows performing SQL-like statements on tabular text data
  • Its purpose is to bring SQL expressive power to the Linux command line and to provide easy access to text as actual data
  • Query should be an SQL-like query which contains filenames instead of table names
  • Use -H to signify that the input contains a header line
  • Column types are auto detected by the tool, no casting is needed
  • Query/Input/Output encodings are fully supported

Project Samples

Project Activity

See All Activity >

License

GNU General Public License version 3.0 (GPLv3)

Follow q - Text as Data

q - Text as Data Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of q - Text as Data!

Additional Project Details

Operating Systems

Linux, Windows

Programming Language

Python

Related Categories

Python System Software, Python Systems Administration Software, Python Command Line Tools

Registered

2021-07-14