Skip to main content

A simple package to interact with the Qualtrics API

Project description

QualtrUtils - A package to create questions from templates with Qualtrics (v3) API

PyPI pyversions GitHub license PyPI Maintaner Tests Release

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

Using PIP:

pip install qualtrutils

Using CONDA:

conda install -c emanuele-albini 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.

This configuration it's optional, the settigs can be directly passed to QualtricsSurvey at runtime.

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


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.5.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

qualtrutils-0.1.5-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file qualtrutils-0.1.5.tar.gz.

File metadata

  • Download URL: qualtrutils-0.1.5.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for qualtrutils-0.1.5.tar.gz
Algorithm Hash digest
SHA256 0b256fc42a05c83893bda0f61ce453b0851918b584df79b597e93954f053ea25
MD5 865d00e3736c76120fd1c32b528df720
BLAKE2b-256 1a329621740f3d757bed55971286744e42f1bf541aeb8475eae23df0848c8c8e

See more details on using hashes here.

File details

Details for the file qualtrutils-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: qualtrutils-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for qualtrutils-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 108a84afc02c85fec730dbf19bafb6bc746197712c858f4131609e072dbdc0bd
MD5 c0a7d6ad55074872d15427b74fc8678e
BLAKE2b-256 09503fe6d91e52025bd8a1cfc2bdab843d527c5bb234356ae0c5400efdb80740

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page