Mapping keys from 3 different jsons in python 3 from Survey Monkey. -
i'm working survey monkey's api , having included following keys in code. below respective json structures. trying map data every survey_id, can see every custom_id , custom_id's individual answers (survey details). after combining information, put in database. what's best way combine/map data?
1) survey_id:
{ "title": "my survey", "language": "en", "question_count": 0, "page_count": 0, "date_created": "2015-10-06t12:56:55+00:00", "date_modified": "2015-10-06t12:56:55+00:00", "id": "1234", "href": "http://api.surveymonkey.com/v3/surveys/1234", "buttons_text": { "done_button": "done", "prev_button": "prev", "exit_button": "exit", "next_button": "next" }, "custom_variables": { "name": "label" }, "preview": "https://www.surveymonkey.com/r/preview/" }
2) custom_id:
{ "data": { "page": 1, "page_size": 5, "respondents": [ { "analysis_url": "https://www.surveymonkey.com/mysurvey_responsesdetail.aspx?sm=2k1fgyx4h3_2fspnry_2bgzlcgrheodtlq7yvncz8ozoxwjdxzcidfqem7vhawcyfyi725m6bqtrxzlm_0ankz8bbpiow_3d_3d", "custom_id": "", "date_modified": "2013-04-17 21:44:46", "date_start": "2013-04-17 21:44:37", "first_name": "", "respondent_id": "2500098680" } ] }, "status": 0 }
3) respondent_id , survey_id
{ "data": [ { "questions": [ { "answers": [ { "col": "3024965133", "row": "3024965139" }, { "col": "3024965134", "row": "3024965140" }, { "col": "3024965135", "row": "3024965141" }, { "row": "0", "text": "other!" } ], "question_id": "316084770" }, { "answers": [ { "col": "3024965125", "row": "3024965122" }, { "col": "3024965124", "row": "3024965123" } ], "question_id": "316084761" }, { "answers": [ { "row": "3024959616" } ], "question_id": "316083321" }, { "answers": [ { "row": "0", "text": "this open answer" } ], "question_id": "316083320" }, { "answers": [ { "col": "3024962639", "row": "3024962638" }, { "col": "3024962640", "row": "3024962637" }, { "col": "3024962639", "row": "3024962636" } ], "question_id": "316084090" }, { "answers": [ { "row": "3024964761", "text": "9" }, { "row": "3024964762", "text": "1" } ], "question_id": "316084724" } ], "respondent_id": "2500019027" } ], "status": 0 }
4) survey_id (sample of json)
{ "data": { "date_created": "2013-02-01 23:55:00", "date_modified": "2013-05-14 17:19:00", "language_id": 1, "num_responses": 13, "pages": [ { "heading": "", "page_id": "101119927", "questions": [ { "answers": [], "heading": "open answer question", "position": 1, "question_id": "316083320" }, { "answers": [ { "answer_id": "3024959615", "position": 1, "text": "answer 1", "type": "row", "visible": true }, { "answers": [ { "answer_id": "3024962636", "position": 1, "text": "row 1", "type": "row", "visible": true
Comments
Post a Comment