Generate PowerPoint slides from Unicom data with Python

Script Python (or any other language) to generate dozens of slides in multiple languages

Geir Freysson
Datasmoothie

--

Unicom Intelligence (formerly known as SPSS Dimensions) is one of the most popular enterprise survey platforms on the market. It’s ability to run complicated surveys and its detailed meta-data make it a favourite among many market research veterans.

Using Tally, Datasmoothie’s API for research data automation, any language can be used to perform common data processing tasks with Unicom data, such as cleaning, weighting, and creating nets. Tally can also be used to generate deliverables, such as PowerPoint files, Excel tables or online dashboards. This opens up a whole new world of automation and efficiency savings.

Load your mdd/ddf files

We are using the Python wrapper for Tally, which can be installed with pip. Tally is a RESTful API, so any other language can be used, but Python is our go-to language.

pip install datasmoothie-tally-client

Unicom data is stored in two files, with extensions ddf and mdd — sqlite and XML files, respectively.

First, we read these into Tally (you need an API key, get in touch to get one):

import tallydataset = tally.DataSet(api_key=my_tally_api_key)
dataset.use_unicom('MuseumSurvey.mdd',
'MuseumSurvey.ddf')

Once the two Unicom files have been loaded, we can query the contents to get a list of variables. Tally supports Unicom’s single choice, multiple choice and even grid questions (which we call arrays).

Once we’ve decided what questions we want in our PowerPoint files, we add the last lines of the script:

for lang in ['en-EN', 'es-ES', 'ja-JP']:
dataset.build_powerpoint(filename='my_slides.pptx',
powerpoint_template='my_brand.pptx',
x=questions,
y=['@'] + crosstabs,
lang=lang)

Tally will return a PowerPoint deck, branded according to themy_brand.pptx file, with one slide for every question crossed with whatever variables are in the y variable list. Furthermore, there will be PowerPoint files in English, Spanish and Japanese.

Native Excel/Office charts

The resulting PowerPoint files have the same branding as the my_brand.pptx file sent with the request to Tally. Furthermore, the charts are native Excel charts so they follow the colour scheme of the template file and can be copy-pasted and altered to suite a users’s reporting needs. Tally can also generate Excel tables and dashboards, which we will cover in later posts.

Click here to read more about Tally, the API for research data automation.

--

--

Co-founder of Datasmoothie. I also maintain the open-source survey data library Quantipy and it’s enterprise equivalent Tally.