Python wrapper for SurveyMonkey API


Keywords
SurveyMonkey
License
MIT
Install
pip install surveymonty==0.2.5

Documentation

SurveyMonty

This is a Python wrapper for the SurveyMonkey API. Why the name? Because this is a wrapper in Python, and Python makes me think of Monty Python. Also, "monkey" and "Monty" both start with "mon", hence SurveyMonty.

Installation

$ pip install surveymonty

Example

This wrapper is very lightweight and provides no object encapsulation of the responses. Rather, it provides the API methods in Python form, through which you can obtain the JSON responses and do with them as you please.

Note, the API requires an access token and api key. You can provide these either through environment variables or in the code itself.

Setting credentials through environment variables

export SURVEY_MONKEY_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
export SURVEY_MONKEY_API_KEY="YOUR_API_KEY"

Sample Python script using SurveyMonty:

import surveymonty

api = surveymonty.Client()
api.get_survey_list() # retrieve survey ids
api.get_survey_details(SURVEY_ID) # use a SURVEY_ID from above

Setting credentials in code

import surveymonty

ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"
API_KEY = "YOUR_API_KEY"

api = surveymonty.Client(ACCESS_TOKEN, API_KEY)
api.get_survey_list()
api.get_survey_details(SURVEY_ID)

Available API Methods

  • get_survey_details()
  • get_survey_list()
  • get_collector_list()
  • get_respondent_list()
  • get_responses()
  • get_response_count()
  • get_user_details()

License

This content is released under the MIT License.

Changes

0.1.19

Added version number for "requests".

0.1.18

  • Synced version number with PyPI.
  • Added "requests" module to install_requires in setup.py.

0.1.16

Bug fix.

0.1.15

Bug fix.

0.1.14

Bug fix.

0.1.13

Bug fix.

0.1.12

Changed order of arguments in get_response.

0.1.11

Updated get_response method to work with paged results.

0.1.10

Use wheel.

0.1.9

Fix.

0.1.8

Reattempt failed queries.

0.1.7

Remove print statement.

0.1.6

Bug fix.

0.1.5

Bug fix.

0.1.4

Input accepts numbers for IDs.

0.1.3

Made error handling more robust.

0.1.2

Bug fix.

0.1.1

Moved ACCESS_TOKEN and API_KEY access to environment variables.