Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
5-liner: reeee solution in Clear category for YAML. Simple Dict by przemyslaw.daniel
import re
def yaml(text):
pairs = re.findall(' *(.+) *: *(.+) *', text)
return {k: int(v) if v.isdigit() else v for k, v in pairs}
Nov. 8, 2019