Opentopia Directory Encyclopedia Tools

YAML

Encyclopedia : Y : YA : YAM : YAML



 

YAML is a human-readable data serialization format that takes concepts from languages such as XML, C, Python, Perl, as well as the format for electronic mail as specified by RFC [2822]. YAML was first proposed by Clark Evans in 2001, who designed it together with Ingy döt Net and Oren Ben-Kiki.

YAML is a recursive acronym meaning "YAML Ain't Markup Language". Early in its development, YAML was said to mean "Yet Another Markup Language", retronymed to distinguish its purpose as data-centric, rather than document markup. However since XML (a true document markup language) is frequently used for data serialization, it is reasonable to consider YAML a lightweight markup language.

Features

YAML was created with the belief that all data can be adequately represented by combinations of lists, hashes (mappings), and scalar (single value) data. The syntax is relatively straightforward and was designed with human readability in mind, but also to be easily mapped to data types common to most high-level languages. In addition, YAML uses a notation based on indentation and/or a set of sigil characters distinct from those used in XML, making the two languages easily composable.

YAML requires that colons and commas used as list separators be followed by a space so that scalar values containing embedded punctuation (such as 5,280 or http://www.wikipedia.org) can generally be represented without needing to be enclosed in quotes.

Two additional sigil characters are reserved in YAML for possible future standardisation: the at sign ( @ ) and accent grave ( ` ).

Examples

Lists

--- # Favorite movies, block format
- Casablanca
- Spellbound
- Notorious
--- # Shopping list, inline format
[milk, bread, eggs]

Hashes

--- # Block
name: John Smith
age: 33
--- # Inline

Block Literals

Newlines preserved

--- |
There was a young fellow of Warwick
Who had reason for feeling euphoric
For he could, by election
Have triune erection
Ionic, Corinthian, and Doric

Newlines folded

--- >
Wrapped text
will be folded
into a single
paragraph

Blank lines denote paragraph breaks

Lists of Hashes

- 
- name: Mary Smith
age: 27

Hashes of Lists

men: [John Smith, Bill Jones]
women:
- Mary Smith
- Susan Williams

Implementations

Bindings for YAML exist for the following languages:

See also

Other simplified markup languages include:

External links

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.


Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: