Python to JSON Formatter for d3.js sankey data