What is Yaml:
Human friendly, cross language, Unicode based data serialization language.
Pronounced in such a way as to rhyme with “camel”
Acronym for
YAML
Ain’t
A language used to convert or represent structured data or objects as a series of characters that can be stored on a disk.
Examples:
CSV – Comma separated values
XML – Extensible markup language
JSON – JavaScript object notation
YAML – YAML ain’t markup language
Markup
Language
3. What is YAML?
• Human friendly, cross language, Unicode based data
serialization language.
• Pronounced in such a way as to rhyme with “camel”
• Acronym for
YAML
Ain’t
Markup
Language
4. What is a data serialization language?
• A language used to convert or represent structured data
or objects as a series of characters that can be stored on
a disk.
• Examples:
• CSV – Comma separated values
• XML – Extensible markup language
• JSON – JavaScript object notation
• YAML – YAML ain’t markup language
5. Why YAML if XML?
• Unlike XML which is not easily readable by humans,
YAML was created to be human-friendly and integrate
easily with modern programming languages.
• Unlike with XML, YAML was intended to simplify the
viewing and understanding of config files, log files, object
persistence, and messaging, to allow the programmer to
spend more time programming and less time formatting
data.
6. YAML Design Goals
• As stated in the YAML official specification, the design
goals for YAML in decreasing priority are:
1. YAML is easily readable by humans
2. YAML data is portable between programming languages
3. YAML matches the native data structures of agile languages.
4. YAML has a consistent model to support generic tools.
5. YAML supports one-pass processing.
6. YAML is expressive and extensible.
7. YAML is easy to implement and use.
8. Basic YAML Syntax Rules
• Documents begin with --- and end with …
• Indentation of lines denotes the structure within the
document.
• Comments begin with #
• Members of lists begin with –
• Key value pairs use the following syntax
• <key>: <value>
9. Basic YAML Syntax Rules
• Example:
---
Student-Id: 11223344
First-Name: John
Last-Name: Smith
Phone-numbers:
- 281.555.7689
- 713.555.8967
- 832.555.9980
Addresses:
- street: 123 Main St.
city: Houston
state: TX
...
10. Advanced YAML Syntax
• There is more advanced syntaxes that exist that allow
YAML to represent
• Relational trees
• *, <<, and & are used for node reference, array merges, and anchoring
respectively
• User defined data types
• These are beyond the scope of this introductory tutorial.