Jaseibert / QualtricsAPI

QualtricsAPI is a lightweight Python Package for the Qualtrics API.
https://www.qualtricsapi-pydocs.com
MIT License
18 stars 13 forks source link

No module named QualtricsAPI.Surveys (Fixed) #6

Closed Jakobhenningjensen closed 11 months ago

Jakobhenningjensen commented 3 years ago

In the guide the following code-snippet is there

from QualtricsAPI.Surveys import Responses  # <== Fails

#Create instances of each
r = Responses()

#Call the method
r.get_responses()

but after inspection of the module, I assume it should be QualtricsAPI.Survey (w/o an "s") i.e

from QualtricsAPI.Survey import Responses  # Removed "s" from "Survey" <== works

#Create instances of each
r = Responses()

#Call the method
r.get_responses(survey_id)
Jaseibert commented 3 years ago

@Jakobhenningjensen Excellent catch. Yeah, the README had a typo. The module is named "Survey" to get responses. However the get_responses() method is currently being deprecated. It will still work, but I recommend you use:

from QualtricsAPI.Survey import Responses

#Create instances of each
r = Responses()

#Call the method
r.get_survey_responses(survey="<survey_id>")

There are quite a few optional arguments that you can pass. I have not updated the documentation, but you can check them out by going to the method @ https://github.com/Jaseibert/QualtricsAPI/blob/master/QualtricsAPI/Survey/responses.py and reading the different params in the docString.