Skip to main content

jqgpt is a gpt powered tool that helps you write jq queries. It takes a human user query and a json file as input and outputs a jq query that answers the user query. It requires an OPENAI_API_KEY to work.

Project description

jqgpt

jqgpt is a gpt powered tool that helps you write jq queries. It takes a human user query and a json file as input and outputs a jq query that answers the user query.

It accomplishes this by sending a very helpful jq prompt with tons of examples and a sample from the json file to the model.

Examples

$ jqgpt 'Get the total number of clams of type dolphin' seaCreatures.json

jq 'map(select(.type == "dolphin").clams) | add' seaCreatures.json
$ cat seaCreatures.json | jqgpt 'Get the names of sea creatures'

jq -r '.[] | .name' seaCreatures.json

Setup

You can install this using

pip install jqgpt

Requirements:

  1. openai python package
  2. OPENAI_API_KEY env var

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jqgpt-0.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

jqgpt-0.1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file jqgpt-0.1.1.tar.gz.

File metadata

  • Download URL: jqgpt-0.1.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for jqgpt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c79ebf2ef7f4a40432189b5a2c63e5938a1701e44b0c65d571ae0b8cca74f83b
MD5 87cced03085835c48e53e921cfa06fd0
BLAKE2b-256 bbafaa8892ac99cbe9dfbf20dd86dc3eaa30f4bcf516999b85cf1aaed3afb368

See more details on using hashes here.

File details

Details for the file jqgpt-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: jqgpt-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for jqgpt-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 665ccd95e96144cfaf3e833ec8de43f5a79930cd36e7d4f0db1316d37dc8380d
MD5 9da8e33b6a4a93802b81588b98a0cec2
BLAKE2b-256 83f6d1102f21f64be0ec06a55a5fa48de7817dc46fda20818f844e86dd1ae1ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page