import datetime, json x = {\'alpha\': {datetime.date.today(): \'abcde\'}} print json.dumps(x)
The above code fails with a TypeError since
TypeError
http://jsonpickle.github.io/ might be what you want. When facing a similar issue, I ended up doing:
to_save = jsonpickle.encode(THE_THING, unpicklable=False, max_depth=4, make_refs=False)