JSONPath Querying
The executor’s built-in path walker only splits on . and indexes — it can’t
do wildcards, recursive descent, or filters, so API/DB responses with arrays are
awkward to extract from. json_query adds a focused JSONPath subset over
already-parsed JSON:
Pure standard library (re); imports no PySide6.
Headless API
from je_auto_control import json_query, json_query_one, json_extract
json_query(data, "$.store.books[*].title") # every title
json_query(data, "$.store.books[?(@.price > 8)].title") # filtered
json_query(data, "$..price") # recursive descent
json_query_one(data, "$.user.name", default="?") # first match or default
json_extract(data, {"name": "$.user.name", # mapping -> flat dict
"first_tag": "$.tags[0]"})
json_query returns all matches (a list); json_query_one returns the
first (or a default); json_extract runs a {key: path} mapping into a flat
dict (first match per path). This is the path engine the existing
AC_http_to_var / API / DB-row flows were missing.
Executor commands
Command |
Effect |
|---|---|
|
|
|
|
data (and mapping) accept a JSON object or a JSON string (so the visual
builder works). The same operations are exposed as MCP tools (ac_json_query /
ac_json_extract) and as Script Builder commands under Data.