Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
result[key] = schema(value.strip()) solution in Clear category for YAML. More Types by veky
def schema(value):
if value.isdigit(): return int(value)
elif value in {'', 'null'}: return None
elif value in {'true', 'false'}: return value == 'true'
else: return value.replace('"', '').replace('\\', '')
def yaml(markup):
result = {}
for line in markup.splitlines():
key, colon, value = line.partition(':')
if colon: result[key] = schema(value.strip())
return result
June 25, 2019
Comments: