A python wrapper for Kobo Data Tool Kit
- This helps get remote data collected easily via kobo forms via consuming the APIS from *.kobotoolbox.org sites.
There are several accounts , you can signup for one:
To get started with kobodata, you have to firstly install the library either directly or using pip.
Use git to clone or you can also manually download the project repository just as shown below;
$ git clone https://github.com/kalokola/kobodata
$ cd kobodata
kobodata $ python setup.py install
# For Windows
pip install --upgrade kobodata
#For Linux | MAC
pip3 install --upgrade kobodata
- You have to sign up at Kobo ToolBox and create your first form.
- To obratin account_token got to your account settings and you will see an API Token section, view the token and copy it to your cip board. The API Token looks like bd1f68af664306q82d62w1412873d3b76b4321
- To obtain the dataset_uuid navigate to your kobo project, select [DATA] to view the table. Inspect the link to your table and copy a section that looks like agLCVHnDkbXRkEuhtp4oUF
- Specify the account_domain for your account kf.kobotoolbox.org or kobo.humanitarianresponse.info
Once you have got the credentials you can proceed as follows.
Here how to fetch real time data
>>> from kobodata import KoboData
>>> account_token = "bd1f68af664306q82d62w1412873d3b76b4321"
>>> dataset_uuid = "agLCVHnDkbXRkEuhtp4oUF"
>>> account_domain = "kf.kobotoolbox.org"
>>> dataset = KoboData(
account_subdomain,
dataset_uuid,
account_token
)
# get number observations
>>> dataset.counts
784 rows
# return a dictionary of results
>>> dataset.get_data
- kalokola
- All other contributors