A simple package to interact with the Qualtrics API
Project description
QualtrUtils - A package to create questions from templates with Qualtrics (v3) API
This package allows the creation of questions based on an existing template (i.e., a question created with the Qualtrics interface. The operations that this package supports are:
- Creating block
- Copying an existing question
- Replacing keywords
- Changing multiple choice answers
- Changing the initial position of the slider
- Changing a question JS code
Installation
Simply run the following command.
pip install qualtrutils
For developers
To use the package in editable mode use instead the following.
git clone https://github.com/emanuele-albini/qualtrutils.git
pip install --editable qualtrutils
Configuration (optional)
Global configuration is in ~\.qualtrutils\qualtrics.toml
. Example:
API_URL = "https://yourdatacenter.qualtrics.com/API/v3/"
API_TOKEN = "your_token"
LIBRARY_ID = "UR_XXXXXXXXXXXXX"
SURVEY_ID = "SV_XXXXXXXXXXXXX"
The configuration saved in ~\.qualtrutils\qualtrics.toml
will be used as default in QualtricsSurvey
constructor.
Usage example
from qualtrutils import QualtricsSurvey
survey = QualtricsSurvey()
# Get a question from an existing survey
question = survey.get_question_by_name('QuestionName', 'MyNewQuestion')
# The following will replace (using regex) all the occurences
# of 'SOMETHING' in the question text and multiples choice answers (if any)
# with 'SOMETHING_ELSE'
question.text_sub('SOMETHING', 'SOMETHING_ELSE')
# The following will set the multiple choice answers
question.set_choices(['First Answer', 'Second Answer', 'Third Answer'])
# The flowwing will set the Javascript code of the question
question.set_js('var hello = 1;')
# Add this new question to the survey in a block called 'Block A'
# If the block does not exists it will be created
survey.create_question(question, 'Block A')
Documentation
See here for the complete documentation with all the functionalities.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qualtrutils-0.1.0.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for qualtrutils-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 862e817454b93f53c02bcf6f7ded5de9863120ce53feb3e9871276b44ff00917 |
|
MD5 | 09cd334ec15c6ab5527779f425f61c49 |
|
BLAKE2b-256 | 1d6f718e712e1cce801dc6942e5c3b96983d0729f54cd4f0512de1b281c78f04 |