Jaseibert / QualtricsAPI

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

Migrate over to New Response Exporter #3

Closed Jaseibert closed 3 years ago

Jaseibert commented 3 years ago

Qualtrics will soon be deprecating the legacy response exporter, so I will be building out the methods for the new exporter. I will also work to include an option to select labels or values as exports.

kgweber-sag commented 3 years ago

Delighted to hear it, I came here to ask whether label/value was an option you were thinking about or whether I should write my own subclass.

Jaseibert commented 3 years ago

@arfenarf I will try to get to it this weekend when I have some time. If you want to subscribe to this thread, I will post the new migrated method and how to use.

Jaseibert commented 3 years ago

@arfenarf @YukunYangNPF I just implemented a fix to the enhancement request about exporting responses with labels. You will need to install the latest version of the package. Use pip install QualtricsAPI==0.4.8 or pip3 install QualtricsAPI==0.4.8 depending on your python installation. Feel free to reach out with questions about usage.

Then to get the responses use:

#1. Import the dependencies
from QualtricsAPI.Setup import Credentials
from QualtricsAPI.Survey import Responses

#2. Set your credentials
Credentials().qualtrics_api_credentials(token='<Your API Token>',data_center='<Your Data Center>')

#3A. Calling get survey responses will return responses using only the categorical labels
df = Responses().get_survey_responses(survey='<Survey ID>', useLabels=True)
df.head()

#3B. Calling get survey responses will return responses with numeric recode values and categorical labels
df = Responses().get_survey_responses(survey='<Survey ID>', includeLabelColumns=True)
df.head()

#3C. Calling get survey responses will return responses with numeric-only recode values
df = Responses().get_survey_responses(survey='<Survey ID>')
df.head()

#4. You may need to use the new question method also.
df = Responses().get_survey_questions(survey='<Survey ID>')
df.head()

Optional Parameters for Responses().get_survey_responses()

kgweber-sag commented 3 years ago

Awesome!

Should setup.py be calling for python-dateutil instead of just dateutil?

Jaseibert commented 3 years ago

@arfenarf Great Catch! I merged your fix and it will be reflect in v0.4.9. Let me know if you have any other issues.