-
-
Notifications
You must be signed in to change notification settings - Fork 23
Home
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.
The YAML Path project provides three things:
- A standard which defines intuitive, command-line friendly syntax for interacting with complex YAML/Compatible data.
- A set of trivial (light-weight and cross-platform) command-line tools for reading and editing YAML/Compatible data.
- Reusable Python libraries designed with a simple API to easily enable other projects to employ YAML Paths.
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 using intuitive path segment notation. 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.
At its inception, the YAML Path project was created for two primary reasons:
- Standardize the most intuitive way to describe nodes -- the complex keys and values -- in YAML and JSON data, and
- 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.