Skip to main content

Library for facilitating survey administration with Qualtrics. Requires Qualtrics API.

Project description

This package includes methods for using the Qualtrics API to:

  • Copy a survey

  • Delete a survey

  • Activate a survey

  • Create a mailing list

  • Delete a mailing list

  • Add contacts to a mailing list

  • Generate unique survey links for members of a mailing list

  • Create a message for the message library

  • Distribute a survey to a mailing list using a message from the message library


Installation

pip install py_qualtrics_api

Overview

Sample usage:

import py_qualtrics_api.tools as pq
import pandas as pd

q = pq.QualtricsAPI('config.yml')

# copy survey
sid = q.copy_survey('SV_0abc05URqqrhMOO', 'My new survey')

# delete survey
success = q.delete_survey(sid)

# copy survey, then activate the new survey
sid = q.copy_survey('SV_0abc05URqqrhMOO', 'My new survey')
success = q.activate_survey(sid)

# create mailing list and add records from a Pandas dataframe
# dataframe must contain an 'email' column (not case sensitive)
# other optional special columns are: 'firstname', 'lastname',
# 'externaldataref', 'unsubscribed' (defaults to false),
# 'language' (defaults to en)
# none of these special column names are case sensitive, so
# ExTeRnAlDaTaRef would be acceptable
mail_list = pd.read_csv('test_mailing_list.csv')
ml_id = q.create_mailing_list('New mailing list',
                              records_to_add=mail_list,
                              list_category='API')

# generate individual survey links for a mailing list
# optional parameter link_type defaults to 'Individual' but other
# valid values are 'Multiple' and 'Anonymous'
# return value is a pandas data frame of the core contact info with
# the following added columns: contactId, exceededContactFrequency,
# 'link', 'linkExpiration', 'status', 'unsubscribed'
links = q.get_links_for_mailing_list(sid, ml_id)

Sample config file (config.yml):

api_token: '4ru9we8fuper9ugergijergoijer34gierj876'
data_center: 'co1'
default_survey_owner: 'UR_3wjehoefof93s'
default_library_owner: 'UR_3wjehoefof93s'

If you don’t wish to store your API token in the configuration file, you can omit that line. If the API token isn’t present in the configuration file, you will be prompted for it when you create a QualtricsAPI object.

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

py_qualtrics_api-0.1.8.tar.gz (6.4 kB view details)

Uploaded Source

File details

Details for the file py_qualtrics_api-0.1.8.tar.gz.

File metadata

  • Download URL: py_qualtrics_api-0.1.8.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for py_qualtrics_api-0.1.8.tar.gz
Algorithm Hash digest
SHA256 16a410d468d38fe7d41c7dbdcd4efbdbeea20dc575a45d8886e779646eb1da06
MD5 46438f1e8e2c4c60dabf9fd131e6e333
BLAKE2b-256 9ed471f8c5b5b14117944860585c3b571d1550da80de8463403242cf17cde04c

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