What is YAML?

By Xah Lee. Date: . Last updated: .

YAML is a data format for similar in purpose as XML and JSON. The design emphasize human-readable. The syntax is similar to python. YAML use indentation for nesting, and doesn't use any type brackets for nesting. The format is line-based (like unix config files).

[see Python 3 in 1 Hour]

YAML file has file extension “.yml”.

Sample YAML file, used by Google App Engine:

application: helloworld
version: 1
runtime: python27
api_version: 1
threadsafe: true

- url: /.*
  script: helloworld.app

Another Sample YAML file, from YAML :

receipt:     Oz-Ware Purchase Invoice
date:        2007-08-06
    given:   Dorothy
    family:  Gale

    - part_no:   A4786
      descrip:   Water Bucket (Filled)
      price:     1.47
      quantity:  4

    - part_no:   E1628
      descrip:   High Heeled "Ruby" Slippers
      size:      8
      price:     100.27
      quantity:  1

bill-to:  &id001
    street: |
            123 Tornado Alley
            Suite 16
    city:   East Centerville
    state:  KS

ship-to:  *id001

specialDelivery:  >
    Follow the Yellow Brick
    Road to the Emerald City.
    Pay no attention to the
    man behind the curtain.

another example, for setting up mongodb.

      database: xyz_dev
        - localhost:27017

      database: xyz_prod
        - localhost:27017
      username: <%= ENV['MONGOID_USERNAME'] %>
      password: <%= ENV['MONGOID_PASSWORD'] %>

Markup Languages

  1. HTML Basics
  2. CSS Basics
  3. Markdown Tutorial
  4. HAML Tutorial
  5. Sass Tutorial
  6. What is YAML?
  7. What's Slim Markup?
  8. Emacs: Org Mode Markup Cheatsheet

If you have a question, put $5 at patreon and message me.