"Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)" - Information and Links:

Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML) - Info and Reading Options

"Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)" and the language of the book is English.


“Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)” Metadata:

  • Title: ➤  Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)
  • Author:
  • Language: English

“Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)” Subjects and Themes:

Edition Identifiers:

  • Internet Archive ID: hpr3252

AI-generated Review of “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)”:


"Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)" Description:

The Internet Archive:

Summary: crvs talks about jq, yq and xq<br />Source: <a href="http://hackerpublicradio.org/eps.php?id=3252" rel="nofollow">http://hackerpublicradio.org/eps.php?id=3252</a><br />Original audio: <a href="http://archive.org/download/hpr3252/hpr3252_source.ogg" rel="nofollow">http://archive.org/download/hpr3252/hpr3252_source.ogg</a><br /><br /><br /><br /><h1>JSON</h1> <p>Json is a cool little data serialization language, that allows you to easily and clearly demarcate blocks of data by nesting data structures such as lists (enclosed by square brackets) and key-value pairs or "dictionaries" (enclosed by curly braces). So that in the end you get something that looks like this</p><pre><code>{<br />"first list" : [ "element1", "element2", {"element3" : "is another k-v pair", "but contains" : ["a" , "list", "of", "words"]}] ,<br />"this value is a string" : "1" ,<br />"and this is a number" : 23 ,<br />"and floating point" : 1.413<br />}</code></pre><p>Aside from:</p> <ul><li>Lists are enclosed in [] and each element is separated by ,</li> <li>Key-value pair lists are enclosed in {} and have the key and value separated by : and each pair is separated by ,</li> <li>Keys have to strings quoted with double quotes</li> <li>Numbers may be left unquoted (but just in value fields)</li> </ul><p>There are no restrictions to what you can do with JSON. Given how explicit the syntax is then, it makes for very easy parsing, and there are plenty of good parser out there. <a href="https://stedolan.github.io/jq/" rel="nofollow">My favourite JSON parser is jq(1)</a>.</p> <p>A canonical representation of the JSON example above can easily be obtained with jq by simply calling <code>jq '' file.json</code> (or piping the file through stdin, or even putting the contents properly quoted as the second argument).</p><pre><code>{<br /> "first list": [<br /> "element1",<br /> "element2",<br /> {<br /> "element3": "is another k-v pair",<br /> "but contains": [<br /> "a",<br /> "list",<br /> "of",<br /> "words"<br /> ]<br /> }<br /> ],<br /> "this value is a string": "1",<br /> "and this is a number": 23,<br /> "and floating point": 1.413<br />}</code></pre><p>You can also use jq in a shell script to obtain, for example the second element of the first list:</p><pre><code>$ jq '."first list"[1]' example.json<br />"element2"</code></pre><p>So to get the value associated to a key you use the notation <code>.key</code> and to get the k-th element you use the notation <code>[k-1]</code>. To remove the quotes on the string you can use the <code>-r</code> flag which stands for raw output.</p> <p><code>jq(1)</code> also gives you a few more functionalities that can be useful like getting the number of elements in a list with the length function.</p><pre><code>$ jq 'length' example.json<br />3<br />$ jq '."first list"[2]."but contains" | length'<br />4</code></pre><p>Another useful feature is getting the list of keys from a key-value pair list which can be done with the function <code>keys</code></p><pre><code>$ jq '."first list"[2] | keys[]' example.json<br />"but contains",<br />"element3"</code></pre><p>The query language is much much more flexible than this, but for most cases this should be enough for simple configuration querying.</p> <h1>YAML and XML??</h1> <p><a href="https://pypi.org/project/yq/" rel="nofollow">The yq project</a> allows one to use the exact same syntax as jq to query, and emit (and therefore also transcode) yaml and XML, extending the usefulness of the query language.</p> <p>So for example looking at the previous file through <code>yq</code> gives:</p><pre><code>$ yq -y '' example.json<br />first list:<br /> - element1<br /> - element2<br /> - element3: is another k-v pair<br /> but contains:<br /> - a<br /> - list<br /> - of<br /> - words<br />this value is a string: '1'<br />and this is a number: 23<br />and floating point: 1.413</code></pre><p>And the output of this can be of course queried with <code>yq</code> itself, or can be used to feed into whatever application requires a yaml input (I guess it lacks the triple dash at the top, but that is actually the only warning I get from passing that abomination to yamllint)</p> <p>Similarly <code>xq</code> can be used to query XML files with the same language. However, to emit these files from json you need to use <code>yq -x</code> like so:</p><pre><code>$ yq -x '' example2.json<br /><br />element1<br />element2<br /><br />is another k-v pair<br />a<br />list<br />of<br />words<br /><br />1<br />23<br />1.413<br /></code></pre><p>where the original (modified) file <code>example2.json</code> looks like:</p><pre><code>{<br /> "file":<br /> {<br /> "first_list": [<br /> "element1",<br /> "element2",<br /> {<br /> "element3": "is another k-v pair",<br /> "but_contains": [<br /> "a",<br /> "list",<br /> "of",<br /> "words"<br /> ]<br /> }<br /> ],<br /> "this_value_is_a_string": "1",<br /> "and_this_is_a_number": 23,<br /> "and_floating_point": 1.413<br /> }<br />}</code></pre><p>So that the root dictionary has a single key-value pair and all the keys have no spaces in them (so that they can be made into xml tags).</p>

Read “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)”:

Read “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)” by choosing from the options below.

Available Downloads for “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)”:

"Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)" is available for download from The Internet Archive in "audio" format, the size of the file-s is: 206.69 Mbs, and the file-s went public at Sat Jan 09 2021.

Legal and Safety Notes

Copyright Disclaimer and Liability Limitation:

A. Automated Content Display
The creation of this page is fully automated. All data, including text, images, and links, is displayed exactly as received from its original source, without any modification, alteration, or verification. We do not claim ownership of, nor assume any responsibility for, the accuracy or legality of this content.

B. Liability Disclaimer for External Content
The files provided below are solely the responsibility of their respective originators. We disclaim any and all liability, whether direct or indirect, for the content, accuracy, legality, or any other aspect of these files. By using this website, you acknowledge that we have no control over, nor endorse, the content hosted by external sources.

C. Inquiries and Disputes
For any inquiries, concerns, or issues related to the content displayed, including potential copyright claims, please contact the original source or provider of the files directly. We are not responsible for resolving any content-related disputes or claims of intellectual property infringement.

D. No Copyright Ownership
We do not claim ownership of any intellectual property contained in the files or data displayed on this website. All copyrights, trademarks, and other intellectual property rights remain the sole property of their respective owners. If you believe that content displayed on this website infringes upon your intellectual property rights, please contact the original content provider directly.

E. Fair Use Notice
Some content displayed on this website may fall under the "fair use" provisions of copyright law for purposes such as commentary, criticism, news reporting, research, or educational purposes. If you believe any content violates fair use guidelines, please reach out directly to the original source of the content for resolution.

Virus Scanning for Your Peace of Mind:

The files provided below have already been scanned for viruses by their original source. However, if you’d like to double-check before downloading, you can easily scan them yourself using the following steps:

How to scan a direct download link for viruses:

  • 1- Copy the direct link to the file you want to download (don’t open it yet).
  • (a free online tool) and paste the direct link into the provided field to start the scan.
  • 2- Visit VirusTotal (a free online tool) and paste the direct link into the provided field to start the scan.
  • 3- VirusTotal will scan the file using multiple antivirus vendors to detect any potential threats.
  • 4- Once the scan confirms the file is safe, you can proceed to download it with confidence and enjoy your content.

Available Downloads

  • Source: Internet Archive
  • All Files are Available: Yes
  • Number of Files: 15
  • Number of Available Files: 15
  • Added Date: 2021-01-09 19:27:39
  • Scanner: Internet Archive Python library 1.9.5

Available Files:

1- Item Tile

  • File origin: original
  • File Format: Item Tile
  • File Size: 0.00 Mbs
  • File Name: __ia_thumb.jpg
  • Direct Link: Click here

2- Flac

  • File origin: original
  • File Format: Flac
  • File Size: 0.05 Mbs
  • File Name: hpr3252.flac
  • Direct Link: Click here

3- VBR MP3

  • File origin: original
  • File Format: VBR MP3
  • File Size: 0.01 Mbs
  • File Name: hpr3252.mp3
  • Direct Link: Click here

4- Ogg Vorbis

  • File origin: original
  • File Format: Ogg Vorbis
  • File Size: 0.01 Mbs
  • File Name: hpr3252.ogg
  • Direct Link: Click here

5- Unknown

  • File origin: original
  • File Format: Unknown
  • File Size: 0.01 Mbs
  • File Name: hpr3252.opus
  • Direct Link: Click here

6- Unknown

  • File origin: original
  • File Format: Unknown
  • File Size: 0.00 Mbs
  • File Name: hpr3252.spx
  • Direct Link: Click here

7- WAVE

  • File origin: original
  • File Format: WAVE
  • File Size: 0.10 Mbs
  • File Name: hpr3252.wav
  • Direct Link: Click here

8- Metadata

  • File origin: original
  • File Format: Metadata
  • File Size: 0.00 Mbs
  • File Name: hpr3252_files.xml
  • Direct Link: Click here

9- Metadata

  • File origin: original
  • File Format: Metadata
  • File Size: 0.00 Mbs
  • File Name: hpr3252_meta.sqlite
  • Direct Link: Click here

10- Metadata

  • File origin: original
  • File Format: Metadata
  • File Size: 0.00 Mbs
  • File Name: hpr3252_meta.xml
  • Direct Link: Click here

11- Ogg Vorbis

  • File origin: original
  • File Format: Ogg Vorbis
  • File Size: 0.01 Mbs
  • File Name: hpr3252_source.ogg
  • Direct Link: Click here

12- Columbia Peaks

  • File origin: derivative
  • File Format: Columbia Peaks
  • File Size: 0.00 Mbs
  • File Name: hpr3252.afpk
  • Direct Link: Click here

13- PNG

  • File origin: derivative
  • File Format: PNG
  • File Size: 0.00 Mbs
  • File Name: hpr3252.png
  • Direct Link: Click here

14- Spectrogram

  • File origin: derivative
  • File Format: Spectrogram
  • File Size: 0.00 Mbs
  • File Name: hpr3252_spectrogram.png
  • Direct Link: Click here

15- Archive BitTorrent

  • File origin: metadata
  • File Format: Archive BitTorrent
  • File Size: 0.00 Mbs
  • File Name: hpr3252_archive.torrent
  • Direct Link: Click here

Search for “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)” downloads:

Visit our Downloads Search page to see if downloads are available.

Find “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)” in Libraries Near You:

Read or borrow “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)” from your local library.

Buy “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)” online:

Shop for “Hpr3252 :: Simple JSON Querying Tool (also YAML, And To A Lesser Extent XML)” on popular online marketplaces.