serialize a class with an object that uses JSON in python code example
Example: python class json serializable
import json
class Object:
def toJSON(self):
return json.dumps(self, default=lambda o: o.__dict__,
sort_keys=True, indent=4)