Skip to content
forked from mvpdev/xls2xform

A Python script to convert properly formatted excel files into xforms for ODK.

Notifications You must be signed in to change notification settings

jbeorse/xls2xform

 
 

Repository files navigation

License: BSD

xls2xform is a Python script designed to make writing surveys for Open Data Kit a snap. To start, check out some files in example_xls to get an idea of the survey language accepted by the script.

To use the script run the following command:

python xls2xform.py file.xls

This creates an xform for each worksheet in surveys.xls (excluding the sheet named "Select Choices", which describes multiple choice options).

How to use xls2xform with Open Data Kit

I need to get surveys up and running on the phones.

  1. Design survey. What questions does this survey intend to answer? What survey data is needed to answer these questions?
  2. Write survey in Excel survey language described on http://xform.childcount.com
  3. Convert the Excel file into XForms for Open Data Kit on http://xform.childcount.com
  4. Log in to an ODK Aggregate server and upload your XForms. There are two options if you receive an "Error: Form Already Exists for this Namespace/Id attribute". You can delete the form that already exists on the server and try uploading your form again (deleting the form deletes all data that has been collected for this form). Or you can give your form a new name, change the name of the corresponding excel worksheet and go back to step 3.
  5. Download the XForms to the phone from http://childcount.appspot.com
  6. Enter data on the phone

Document all features

  • I need to do this in xls2xform.py
  • XML tag
  • max length of multiple choice value, tag?

Technical Notes

Embedding this app in a django project

urls.py:

from django.conf.urls.defaults import *

urlpatterns = patterns('',
    (r'^', include('project-name.xls2xform.urls')),
)

In the Production App, urls.py is not used to serve static content. All static directives set in urls.py need to be transferred over to the Apache configuration file in order to work with mod_wsgi.

Shortcut for working with the Android emulator

Thanks to Mårten Österberg.

#!/bin/bash
# copy all forms in this folder over to emulator and start emulator
sudo mount -o loop ~/.android/avd/my_avd.avd/sdcard.img /media/sdcard
sudo cp *.xml /media/sdcard/odk/forms/
sudo umount /media/sdcard/
~/android-sdk-linux_86/tools/emulator -avd my_avd &

About

A Python script to convert properly formatted excel files into xforms for ODK.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.9%
  • JavaScript 1.1%