def nest(d):
    rv = {}
for key, value in d.items():
    node = rv
for part in key.split('/'):
    node = node.setdefault(part, {})
node.update(value)
return rv
Need to create a layered dict from a flat one