Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.27 KB

File metadata and controls

39 lines (27 loc) · 1.27 KB

JQ-By-Example

PyPI Python 3.10+ License: MIT

AI-powered jq filter synthesis from input/output JSON examples.

You know what JSON transformation you want, but writing the jq filter is tricky? Just provide examples — JQ-By-Example synthesizes the filter for you.

Installation

pip install jq-by-example

Requires jq binary: brew install jq (macOS) or apt install jq (Linux)

Quick Start

export OPENAI_API_KEY='sk-...'

jq-by-example \
  --input '{"user": {"name": "Alice"}}' \
  --output '"Alice"' \
  --desc "Extract name"

# Output: .user.name

Features

  • 🤖 LLM-Powered — Uses OpenAI, Anthropic, or local Ollama
  • 🔄 Iterative Refinement — Automatically improves filters based on feedback
  • Verified — Executes against real jq binary to ensure correctness
  • 📊 Diagnostics — Detailed error classification and scoring

Documentation

Full documentation: github.com/nulone/jq-by-example