Observed since 20 Oct, 17:44 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
run SQL queries on JSON data
abstra-json-sql is a Python library that allows you to run SQL queries on JSON data. It is designed to be simple and easy to use, while providing powerful features for querying and manipulating JSON data.
[!WARNING]
This project is in its early stages and is not yet ready for production use. The API may change, and there may be bugs. Use at your own risk.
You can install abstra-json-sql using pip:
pip install abstra-json-sql
Assuming you have a directory structure like this:
.
├── organizations.json
├── projects.json
└── users.json
You can query the JSON files using SQL syntax. For example, to get all users from the users file, you can run:
abstra-json-sql "select * from users"
Or using the explicit query subcommand:
abstra-json-sql query --code "select * from users"
This will return all the users in the users.json file.
You can also run the CLI in interactive mode:
abstra-json-sql
This will start an interactive SQL prompt where you can type queries and see results immediately.
You can create new tables interactively using the create table command:
abstra-json-sql create table --interactive
This will guide you through the process of creating a new table by asking for:
The interactive table creation supports:
int, string, float, boolYou can specify the output format using the --format option:
abstra-json-sql "select * from users" --format csv
abstra-json-sql "select * from users" --format json
You can also use abstra-json-sql in your Python code. Here's an example:
from abstra_json_sql.eval import eval_sql
from abstra_json_sql.tables import InMemoryTables, Table, Column
code = "\n".join(
[
"select foo, count(*)",
"from bar as baz",
"where foo is not null",
"group by foo",
"having foo <> 2",
"order by foo",
"limit 1 offset 1",
]
)
tables = InMemoryTables(
tables=[
Table(
name="bar",
columns=[Column(name="foo", type="text")],
data=[
{"foo": 1},
{"foo": 2},
{"foo": 3},
{"foo": 2},
{"foo": None},
{"foo": 3},
{"foo": 1},
],
)
],
)
ctx = {}
result = eval_sql(code=code, tables=tables, ctx=ctx)
print(result) # [{"foo": 3, "count": 2}]
# Query all records from a table
abstra-json-sql "SELECT * FROM users"
# Query with conditions
abstra-json-sql "SELECT name, email FROM users WHERE age > 25"
# Start interactive table creation
abstra-json-sql create table --interactive
# Example interaction:
# Table name: employees
# Column name: id
# Column type for 'id' (int/string/float/bool): int
# Is 'id' a primary key? (y/N): y
# Column name: name
# Column type for 'name' (int/string/float/bool): string
# Column name: salary
# Column type for 'salary' (int/string/float/bool): float
# Does 'salary' have a default value? (y/N): y
# Default value for 'salary': 0.0
# Column name: (press Enter to finish)
# JSON output (default)
abstra-json-sql "SELECT * FROM users" --format json
# CSV output
abstra-json-sql "SELECT * FROM users" --format csv
# Specify a different working directory
abstra-json-sql "SELECT * FROM users" --workdir /path/to/json/files
WITH
RECURSIVE SELECT
ALLDISTINCT*FROM
JOIN
INNER JOINLEFT JOINRIGHT JOINFULL JOINCROSS JOINWHEREGROUP BYHAVINGWINDOWORDER BYLIMITOFFSETFETCHFOR INSERT
INTOVALUESDEFAULTSELECTRETURNING UPDATE
DELETE
CREATE
TABLE (via interactive CLI) DROP
ALTER
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.15 | 8 Apr 2026 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:44 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7b404267202fa2e06d84ef50aedf62aa73f1ec1a857232c2adb063fc77b5654b