I feel like there’s a reasonably simple solution out there for my problem.
I’m doing some data manipulation that at the end point gets printed out in a format for highcharts. Currently I’m pulling the whole set of nested dictionaries apart and printing each part out, but I was hoping there was something like JSON.dumps(dict) where the output was formatted with all keys unquoted. So, in code-ish-stuff:
{
'chart': {'backgroundColor': 'Blue',
'borderColor': 'Black',
'renderTo': 'container'},
'xAxis': { ... },
...
}
Outputs to
{
chart: {
backgroundColor: 'Blue',
borderColor: 'Black',
renderTo: 'container'},
xAxis: { ... },
...
}
If I can’t do outputting like this is there a good way to interface with HighCharts from python? I haven’t really ran across one yet, despite some reasonable Google-Fu.
EDIT: I’m working on making this compatible with the Geckoboard – Highcharts plugin where-in I don’t get the access to the full ability of javascript for parsing the output. I need to have it already formatted and ready to roll when I send the data out.
Just provide the valid json text. Examples in your question are not valid json. Using Push API: