jsonStr = json.dumps(myobject.__dict__)
# if you're not using a class for your json you can just do this jsonStr = json.dumps(jsn) # if you want to serialize a class then you need to add the __dict__ jsonStr = json.dumps(jsn.__dict__)