# harelba/q

q - Run SQL directly on delimited files and multi-file sqlite databases

Repository: https://github.com/harelba/q
Canonical: https://ross.abutalabs.com/products/harelba-q
Homepage: http://harelba.github.io/q/
Language: Python
License: GPL-3.0
License Family: copyleft
Topics: python, sql, cli, command-line-tool, textasdata, q, qtextasdata, csv, tsv, command-line, sqlite, sqlite3, database
Last push: 2026-02-06T23:25:37+00:00

## Health v2 (maintenance only)
Score: 52/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 66, release rhythm 8, longevity 100
- inputs: {"age_days": 5329, "days_push": 208, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 10361, forks 424 (observed 2026-08-28T04:10:41.791480+00:00)

## What it is
q is a Python command-line tool that lets you run SQL queries directly on delimited text files (CSV/TSV) and multi-file sqlite3 databases, treating files as database tables. It supports full SQL constructs, automatic column/type detection, and optional caching that dramatically speeds up repeated queries.

## Use cases
- run SQL queries on csv files from the command line
- query tsv files with SQL without loading into a database
- join data across multiple sqlite database files
- analyze command output piped into SQL, like ps -ef
- count and group rows in large delimited files quickly
- ad-hoc data analysis on text files without ETL

## When to choose
- you want SQL power over CSV/TSV files without importing them into a database
- you need to query multiple sqlite databases in a single statement
- you do quick ad-hoc analysis in shell scripts or pipelines

## When to avoid
- you need a persistent relational database with indexes and concurrent writes
- you work with nested or binary data formats like JSON or Parquet
- you need very large-scale analytics better suited to Spark or DuckDB

## Facets
- artifact type: cli-tool
- maturity: active
- function: cli, database, csv, search-engine
- domain: developer-tools, data-science, files
- platform: windows, python, cli
- tags: sql, text-as-data, tsv, sqlite, data-analysis, command-line-tool, command-line, linux, macos

## Member repositories
- harelba/q (main) score 52

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:41.791480+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:19:06.979461+00:00, confidence not recorded.
  - readme: https://github.com/harelba/q (fetched 2026-08-28T04:10:41.791480+00:00, sha 7eb4f6392d4a)
  - homepage: http://harelba.github.io/q/ (fetched 2026-08-29T08:18:21.896676+00:00, sha f4edaea1a755)
- Data as of 2026-08-30T08:39:29.467469+00:00.
