Split the path by :
and start from the last element, encapsulating each one into its container:
def path_to_tree(p):
elems = p.split(':')
head = None
for elem in reversed(elems):
head = {'title': elem, 'children': [] if head is None else [head]}
return head