What is YAML?
What is YAML
- YAML is a data format for similar purpose as XML and JSON.
- YAML syntax is indentation based, similar to python. 〔see Python 3 Tutorial〕
- YAML file has file name extension “.yml”.
Sample YAML Code
Sample YAML file, used by Google App Engine:
application: helloworld version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /.* script: helloworld.app
Another Sample YAML file, from Wikipedia:
--- receipt: Oz-Ware Purchase Invoice date: 2007-08-06 customer: given: Dorothy family: Gale items: - 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.
development: sessions: default: database: xyz_dev hosts: - localhost:27017 production: sessions: default: database: xyz_prod hosts: - localhost:27017 username: <%= ENV['MONGOID_USERNAME'] %> password: <%= ENV['MONGOID_PASSWORD'] %>