What is the difference between .yaml and .yml extension? [duplicate]

File extensions do not have any bearing or impact on the content of the file. You can hold YAML content in files with any extension: .yml, .yaml or indeed anything else. The (rather sparse) YAML FAQ recommends that you use .yaml in preference to .yml, but for historic reasons many Windows programmers are still scared of using extensions with more than three characters … Read more

How do I install the yaml package for Python?

You could try the search feature in pip, which looks for packages in PyPI with yaml in the short description. That reveals various packages, including PyYaml, yamltools, and PySyck, among others (Note that PySyck docs recommend using PyYaml, since syck is out of date). Now you know a specific package name, you can install it: If you … Read more

YAML equivalent of array of objects in JSON

TL;DR You want this: Mappings The YAML equivalent of a JSON object is a mapping, which looks like these: Note that the first characters of the keys in a block mapping must be in the same column. To demonstrate: Sequences The equivalent of a JSON array in YAML is a sequence, which looks like either … Read more

YAML Multi-Line Arrays

A YAML sequence is an array. So this is the right way to express it: That’s identical in meaning to: It’s also legal to split a single-line array over several lines: and even have multi-line strings in single-line arrays:

What is the difference between YAML and JSON?

Technically YAML is a superset of JSON. This means that, in theory at least, a YAML parser can understand JSON, but not necessarily the other way around. See the official specs, in the section entitled “YAML: Relation to JSON”. In general, there are certain things I like about YAML that are not available in JSON. As @jdupont … Read more