About This File
Create / Test / Learn JSON Processing
jqPlayground is an interactive, jq-based, tool created using AutoIt. The purpose of the tool is to help in the creation, testing, and understanding of JSON filters/queries used in the processing of JSON datasets. Internally, it uses the jq UDF for all JSON processing. The dot and bracket notation access in jq are similar to other existing AutoIt JSON parsing UDFs and tools. Therefore, jqPlayground can be used as a general purpose testing & learning tool, regardless of the ultimate UDF or utility you choose to use. jqPlayground comes with numerous examples to help you see and understand how it can be used for simple parsing and much more advanced JSON processing. You can modify and play with the example filters or you can create and test your own.
CONFIGURATION The only requirement needed to run jqPlayground is that it can find a jq executable. JQ executables can be found on the JQ website on the home page, its download section, or as a part of my JQ UDF in the AutoIt Downloads section. The latest jq executables have been included in the zip file. jqPlayground will look for the jq executable in the following order of precedence: 1. If a jqPlayground.ini file exists in the script directory, it will get the path to the jq executable under to following section and key: [CONFIG] JqExePath=<full path to jq exe> 2. A jq-win32.exe or jq-win64.exe, depending on the OS, in the script directory. 3. A jq.exe in the script directory. USAGE The interface is pretty simple and straight forward. Paste, load or write whatever JSON you want to play with in the INPUT section. Paste or write whatever parsing or processing filter(s) you want to test in the FILTER section. If necessary, you can select or enter any jq-specific flags you want. Then, either press the RUN button, F5 or CTRL+ENTER to execute your filter. You will see the output in the OUTPUT section. If your command was not successful, you will see the error message generated by JQ in the output section. There are also numerous examples that can be selected from EXAMPLES dropdown list. Upon selecting an example, it populates the filter, flags, and input as necessary. It then executes the example, showing the output in the OUTPUT section. The examples use one of 2 JSON datasets. BOOKS is a small, simple, JSON dataset that contains a catalog of book information. The NFL JSON dataset is much larger and complex. It is a snapshot of NFL game information during week 1 of the 2018 regular season. Some of the NFL JSON dataset examples really show off the speed and processing capabilities of JQ. If you want to dump the full path of every scalar JSON value in your JSON dataset, you can type "dump" in the FILTER section and press F5, CTRL+ENTER or the RUN button. The output is the same as the jqDump() function in the jq UDF. "Dump" is not a jq filter command. It is a special command that I added to help those new to JSON understand how to access a given JSON value using dot-notation. Lastly, right below the output section, you will see the time it took to execute your filter. This can be useful to those in which timimg is a major concern. jqPlayground HotKeys -------------------- Open the online jq manual - F1 Run the jq filter - F5 or Ctrl+Enter Clear/reset all fields - Alt+C Load a JSON from a file - Alt+L Save your current session - Ctrl+S Load a saved session - Ctrl+L Special Commands (Enter and run in filter) ------------------------------------------ dump - List full path of every scalar JSON value clear - Clear/reset all fields (same as Alt+C)
USEFUL LINKS
jq Home Page: https://jqlang.github.io/jq/
jq Manual: https://jqlang.github.io/jq/manual/
jq Downloads: https://jqlang.github.io/jq/download/
jq Tutorial: https://jqlang.github.io/jq/tutorial/
jq Wiki: https://github.com/jqlang/jq/wiki
Edited by TheXman
Updated the jq documentation links to point to the new repository
What's New in Version v1.3.5
Released
- Slight correction to the logic that determines the path to the jq executable, if it can be determined.