Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
You keep using that word. solution in Clear category for YAML. More Types by veky
import codecs
def schema(value):
if value.isdigit(): return int(value)
elif value in {'', 'null'}: return None
elif value in {'true', 'false'}: return value == 'true'
elif value[0] == value[~0] in {'"', "'"}:
return value[1:-1].encode('utf-8').decode('unicode_escape')
else: return value
def yaml(markup):
result = {}
for line in markup.splitlines():
key, colon, value = line.partition(':')
if colon: result[key] = schema(value.strip())
return result
Nov. 9, 2019
Comments: