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
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
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