python code to generate json for tree map

can use, but slow