DIML (Dot-Indicated Markup Language)

A new way to YAML — a proposition for new data format

Background

YAML Problems

valid YAML
yamllint (py)
prettyfied JSON, note that the comments in YAML file are lost in generated JSON

Enter DIML

valid DIML
invalid DIML
Comments are included in DIML 1 liner (DIML-OL)
compact HR (human readable) DIML (DIML-HR)
for key, value in json_data.items():
print key, ':', value
d = diml.load('mydata.diml')get all keys with 1 dot (dot level 1)
d.get_key(1) #
# first_name
# last_name
# age
# address
get all keys with 2 dots (dot level 2)
d.get_key(2)
# street
# apartment
# city
# state
to get all values of dot level 3
d.get_val(3)
# 125 broadway
# 19D
# san francisco
to get all keys and values of any dot-level, lets say 3
d.get_all(3)
# address.street.125 broadway
# address.apartment.19D
# address.city.san francisco

Finally