Skip to content
William W. Kimball, Jr., MBA, MSIS edited this page Feb 8, 2020 · 24 revisions

YAML Path

The README file touches on all of the major aspects of this YAML Path project. This Wiki provides a deeper dive into some of them. We'll start with a restatement of just what YAML Path is.

What is a YAML Path?

A YAML Path is a human-friendly means of identifying or searching for one or more nodes within YAML, EYAML, or compatible data structures like JSON. The core idea here is to make it easy to find or change the data users need from the command-line, other text input, or Python API. In fact, multiple representations of YAML Paths are supported, enabling users to express paths in whatever way is most intuitive to them.

Wait... did you say JSON? Yes; any valid JSON is also valid YAML, so YAML Paths also work perfectly well against JSON data.

What is YAML Path For?

At its inception, the YAML Path project was created for two primary reasons:

  1. Standardize the most intuitive way to describe nodes -- the complex keys and values -- in YAML and JSON data, and
  2. Make trivial a means of accessing and editing YAML and JSON data, notably from the command-line.

For the first objective, guidance was taken from sources like Puppet's Hiera engine and the W3C XPath standard. For the second, considerable expertise in command-line and file parsing was applied toward implementing this YAML Path standard via as simple an API as possible. This project also supplies reference command-line implementations of the API, enabling YAML Path consumers to try it out right away.

In other words, this project strives to allow users and other developers to parse and edit YAML, EYAML, JSON, and compatible data streams and files with as little effort as possible. Sure, many people can write their own program to read such data but it takes a lot of code and intimate knowledge of the data to reliably zero-in on any particular piece of data; more so to affect changes to the data without corrupting it or crashing in the process. This project abstracts away all of the boilerplate, the error-handling, and the guesswork of writing your own code to perform the same tasks while promoting an intuitive means of addressing the desired data elements.

This project also adds advanced query capabilities not otherwise available from stock data parsers.

Clone this wiki locally