Repository navigation
Home
[insert logo here]
##What is qual2db? qual2db is an object-based python package that transforms Qualtrics survey data into a multiple tables (Surveys, Blocks, Questions, Choices, Answers, Respondents, Responses) and uploads it into a MySQL relational database.
qual2db was created by the Center for Social Research (CSR) at Calvin College to replace the useful relational database structure formerly provided by the Inquisite survey system.
##Why is qual2db useful? There are many advantages to using a RDB for storing and managing survey data. A few of the biggest are:
A master archive
Have a lot of survey data? qual2db lets you stop worrying about spreadsheets, SPSS files, and folder paths, because all your survey data can be stored in one place in a standard format.
Sharing data is easy
Need to share data across your research team? Using qual2db's master RDB means that everyone's reporting and analysis tools can point to one raw master dataset simultaneously.
Powerful queries
qual2db's RDB structure allows you to create powerful stacked queries for analysis and visualization. It is also easy to perform cross-survey analysis, since all your survey data is in the same place and the same format.
qual2db is composed of three python objects (or classes). The qualInterface and the sqlInterface communicate with the Qualtrics API and a MySQL database respectively. The survey object uses both these objects to transfer and process data between systems.
The folder is structure below:
qual2db/
__init__.py
config.ini
config.py
qualInterface.py
sqlInterface.py
survey.py
When a Qualtrics survey is brought into a MySQL database it is stored in MySQL RDB that has 5 related tables.
| Table | Description |
|---|---|
| surveys | information about the survey |
| blocks | survey question blocks |
| questions | questions and embedded data fields with detailed information |
| choices | question choices |
| answers | answers options for matrix and side-by-side questions |
| respondents | survey respondents with information |
| responses | every question response for every respondent |
qual2db is very easy to install. It was deliberately designed to only use built-in Python modules so all you need is Python 2.7--no dependencies required.
- Python 2.7
- A Qualtrics account with API access
- A MySQL database
- The Python-MySQL ODBC connector for Python 2.7.
At this point the best way to use qual2db is to download the code, unzip it somewhere in your workspace and then write scripts in the same directory of the folder that import it as qual2db.
Once you have downloaded and unzipped the code you must enter your credentials into the configuration file (config.ini).
###Qualtrics Credentials
| Credential | Description |
|---|---|
| basurl | Leave this as the default: https://survey.qualtrics.com/WRAPI/ControlPanel/api.php?
|
| User | The Qualtrics username of an account with API access |
| Password | The account password |
| Version | The API version. Leave this as the default: 2.3. |
###MySQL Credentials
| Credential | Description |
|---|---|
| sqlUser | MySQL username with read/write privileges |
| sqlPassword | MySQL account password |
| sqlHost | Database server url |
| sqlDB | The database where the qual2db tables will be stored |
##Setting up MySQL tables To set up the MySQL table structure write and run a script like this:
import qual2db
qual2db.sqlInterface.configure_db()This will create all the tables needed to store Qualtrics data. It is recommended that you designate a MySQL database for sole purpose of holding these tables.