YAML

[3] It uses Python-style indentation to indicate nesting[3] and does not require quotes around most string values (it also supports JSON style [...] and {...} mixed in the same file).

[4] Custom data types are allowed, but YAML natively encodes scalars (such as strings, integers, and floats), lists, and associative arrays (also known as maps, dictionaries or hashes).

[8] Some source-code editors such as Vim,[9] Emacs,[10] and various integrated development environments[11][12][13] have features that make editing YAML easier, such as folding up nested structures or automatically highlighting syntax errors.

[1] YAML (/ˈjæməl/, rhymes with camel[4]) was first proposed by Clark Evans in 2001,[15] who designed it together with Ingy döt Net[16] and Oren Ben-Kiki.

Inline Blocks, common in YAML data streams, use comma+space to separate the key/value pairs between braces.

Two features that distinguish YAML from the capabilities of other data-serialization languages are structures[24] and data typing.

[24] For clarity, compactness, and avoiding data entry errors, YAML provides node anchors (using &) and references (using *).

Finally YAML defines a way to extend the data type definitions locally to accommodate user-defined classes, structures or primitives (e.g. quad-precision floats).

Unlike JSON, which can only represent data in a hierarchical model with each child node having a single parent, YAML also offers a simple relational scheme that allows repeats of identical data to be referenced from two or more points in the tree rather than entered redundantly at those points.

This expansion can enhance readability while reducing data entry errors in configuration files or processing protocols where many parameters remain the same in a sequential series of records while only a few vary.

Because there are no closing tags, braces, or quotation marks to balance, it is generally easy to generate well-formed YAML directly from distributed print statements within unsophisticated programs.

Likewise, the whitespace delimiters facilitate quick-and-dirty filtering of YAML files using the line-oriented commands in grep, AWK, Perl, Ruby, and Python.

This makes it very easy to write parsers that do not have to process a document in its entirety (e.g. balancing opening and closing tags and navigating quoted and escaped characters) before they begin extracting specific records within.

Additionally, extremely deep indentation can be avoided entirely by either: 1) reverting to "inline style" (i.e. JSON-like format) without the indentation; or 2) using relational anchors to unwind the hierarchy to a flat form that the YAML parser will transparently reconstitute into the full data structure.

Any YAML parser that allows sophisticated object instantiation to be executed opens the potential for an injection attack.

Perl parsers that allow loading of objects of arbitrary classes create so-called "blessed" values.

[29] The primary logical structures in a YAML instance document are scalars, sequences, and mappings.

[30] The YAML specification also indicates some basic constraints that apply to these primary logical structures.

While extended hierarchies can be written in inline-style like JSON, this is not a recommended YAML style except when it aids clarity.

YAML's minimal use of indicator characters is compared favorably to TOML's strict requirement of quotation marks and square brackets.

[opinion] YAML's use of significant indentation has been contrasted with the dot notation of TOML's key and table names to convey the same semantic structure.

However, there are several externally defined schema descriptor languages for YAML (e.g. Doctrine, Kwalify and Rx) that fulfill that role.

To dump varying, or complex, hierarchical data, however, a dedicated YAML emitter is preferable.

Similarly, simple YAML files (e.g. key-value pairs) are readily parsed with regular expressions.

There used to be another C library, called Syck, written and orphaned by why the lucky stiff: it is unmaintained, there is no authoritative source bundle, and the web site has been hijacked.

[41] Some implementations of YAML, such as Perl's YAML.pm, will load an entire file (stream) and parse it en masse.

YAML makes this easy, since this simply requires splitting on the document end marker, which is defined as three periods at the start of a line followed by a whitespace (and possible a comment).