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

Other Useful Business Software
Secure Cloud Storage for Files, Photos and Documents | pCloud Icon
Secure Cloud Storage for Files, Photos and Documents | pCloud

Store, access, and manage your files on your own terms, from anywhere.

Store, sync, and share your files securely with pCloud. Get up to 10 GB of free secure cloud storage and access your files from any device, anywhere.
Learn More
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