Skip to main content

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

Metadata

Release files for jq-by-example 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jq-by-example 0.2.1
File Size Uploaded
jq_by_example-0.2.1.tar.gz 71.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jq-by-example 0.2.1
File Interpreter ABI Platform
jq_by_example-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 102.0 kB

Release files / jq_by_example-0.2.1.tar.gz

Download URL jq_by_example-0.2.1.tar.gz
Size 71.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c42caa28d2c0fa53519a125176c2a5c6ce8e6e3dfa2aa88018be3c865ed15e9f
BLAKE2b-256 checksum
How to use checksums
738cbff59401aa1f93fc92477c0c27ef150cccb63856dbbcde1f20f78a3a1e32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / jq_by_example-0.2.1-py3-none-any.whl

Download URL jq_by_example-0.2.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d9b589aa0a7959cb2475d3754444b8154b54abd4e7977c9b0e1f602c4c5f053
BLAKE2b-256 checksum
How to use checksums
95d4f9ca5ec13e5e1f0c572301693ec0c12baedeeae99af7135bcf6e29e49c86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page