Ok so I can use an OrderedDict in json.dump. That is, an OrderedDict can be used as an input to JSON.
json.dump
But can it be used as an output? If so how? In my
Simple version for Python 2.7+
my_ordered_dict = json.loads(json_str, object_pairs_hook=collections.OrderedDict)
Or for Python 2.4 to 2.6
import simplejson as json import ordereddict my_ordered_dict = json.loads(json_str, object_pairs_hook=ordereddict.OrderedDict)