Minimalist SQLite-based CLI tool with AI assistance for working with tabular data.
Project description
sqtab
sqtab is a minimalist command-line toolkit with AI assistance for working with tabular data
(CSV / JSON) using SQLite as a lightweight local database layer.
It is built for developers, data analysts, and engineers who want a fast and clean workflow without maintaining a full database runtime.
sqtab provides:
- CSV / JSON → SQLite import
- schema inspection & table listing
- ad-hoc SQL execution
- export to CSV / JSON
- AI-assisted SQL generation (
sqtab sql-ai) - AI-assisted table analysis (customizable tasks & rules)
- optional user-defined AI model via
SQTAB_AI_MODEL
Installation
pip install sqtab
Requires Python 3.10+.
Quick Start
Import CSV or JSON
sqtab import data.csv users
Inspect table schema
sqtab tables --schema
Run SQL queries
sqtab sql "SELECT * FROM users;"
Export a table
sqtab export users users.csv
Reset the local SQLite database
sqtab reset
For all commands:
sqtab --help
AI Features
sqtab integrates with OpenAI models to provide intelligent data assistance.
You must set an API key (environment variable or .env):
OPENAI_API_KEY=your-key-here
You may also set a preferred model (optional):
SQTAB_AI_MODEL=gpt-4o-mini
If not provided, sqtab falls back to a safe default.
1. AI-Generated SQL (sql-ai)
Convert natural-language questions into valid SQLite SQL:
sqtab sql-ai "show all users older than 30"
Example result:
SELECT * FROM users WHERE age > 30;
2. AI-Assisted Table Analysis (analyze)
Analyze structure, sample rows, patterns, anomalies, and more.
Basic usage
sqtab analyze users --ai
Custom tasks & rules
sqtab analyze users --ai \
--task "Identify anomalies" \
--task "Suggest indexes" \
--rule "Be concise"
Load from external files
sqtab analyze users --ai --tasks-file tasks.txt --rules-file rules.txt
Environment Variables
| Variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
Required for AI features | — |
SQTAB_AI_MODEL |
Optional user-preferred model | gpt-4o-mini |
Project Status
sqtab is in active early development (0.x releases).
The core CLI is stable, but new AI features are expanding rapidly.
Feedback, ideas, and contributions are welcome.
GitHub repository:
https://github.com/gojankovic/sqtab
License
MIT License © 2025 Goran Janković
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqtab-0.2.0.tar.gz.
File metadata
- Download URL: sqtab-0.2.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1c588d7bc000b9cfb882f782c0302041ac3ac03f0a809acb7d5ced37bd965a8
|
|
| MD5 |
8060946d172fa0a10ce8e8e51af9b960
|
|
| BLAKE2b-256 |
9efdeeff9de460b348f4ecb3db88419641597bc0c0afa9b647883a4f2dc6d0a4
|
Provenance
The following attestation bundles were made for sqtab-0.2.0.tar.gz:
Publisher:
publish.yml on gojankovic/sqtab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqtab-0.2.0.tar.gz -
Subject digest:
f1c588d7bc000b9cfb882f782c0302041ac3ac03f0a809acb7d5ced37bd965a8 - Sigstore transparency entry: 748055159
- Sigstore integration time:
-
Permalink:
gojankovic/sqtab@20def113563a4364b4c91bc6f29fbf699c425617 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/gojankovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@20def113563a4364b4c91bc6f29fbf699c425617 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sqtab-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sqtab-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e61b7c964310251e7e45b7da38da9356e691f26b8a664bf5c118226bebb97ca
|
|
| MD5 |
85456feb8c0086a479aa93611d0248bb
|
|
| BLAKE2b-256 |
b217479cdc6320486253393c17de81f195005feb45f871ae7a4b8e8f01455520
|
Provenance
The following attestation bundles were made for sqtab-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on gojankovic/sqtab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqtab-0.2.0-py3-none-any.whl -
Subject digest:
2e61b7c964310251e7e45b7da38da9356e691f26b8a664bf5c118226bebb97ca - Sigstore transparency entry: 748055166
- Sigstore integration time:
-
Permalink:
gojankovic/sqtab@20def113563a4364b4c91bc6f29fbf699c425617 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/gojankovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@20def113563a4364b4c91bc6f29fbf699c425617 -
Trigger Event:
push
-
Statement type: