How jamesleondufour/kobo-choice-sync works
This repository synchronizes KoboToolbox “Other” answers into a growing external choices CSV. A Kobo webhook sends the selected value through GitHub Actions to the Python entry point; reconciliation checks existing choices, adds only new values, and updates Kobo media. An explicit catch-up run can scan historical submissions, and manual runs can finish pending media recovery. The README also documents redeployment so collectors can refresh the form. The Python implementation is sampled only in excerpts, so internal links are limited to relationships shown there or documented in the README.
Main entry points: sync.py Reconciliation · sync.yml GitHub Actions · config.json Sync configuration
Components 13
Trigger and entry
- Kobo webhook
- GitHub Actions
.github/workflows/sync.yml - CLI entry point
kobo_sync/sync.py - Sync configuration
config.json
Choice synchronization
- Reconciliation
kobo_sync/sync.py - Choice merge
kobo_sync/sync.py - Historical catch-up
kobo_sync/sync.py - Media recovery
kobo_sync/sync.py
Kobo services
- Kobo API client
kobo_sync/sync.py - Submission history
- Choices CSV media
- Deployed form
Other components
- Form collector
Connections 15
- Form collector → Kobo webhook: submits Other
README.md - Kobo webhook → GitHub Actions: dispatches value
README.md - GitHub Actions → CLI entry point: runs sync
README.md - CLI entry point → Sync configuration: loads settings
README.md - CLI entry point → Reconciliation: invokes
kobo_sync/sync.py - Reconciliation → Kobo API client: requests data
kobo_sync/sync.py - Reconciliation → Choice merge: merges choices
kobo_sync/sync.py - Reconciliation → Media recovery: checks recovery
kobo_sync/sync.py - Reconciliation → Choices CSV media: reads and updates
README.md - Kobo API client → Choices CSV media: reads and uploads
kobo_sync/sync.py - CLI entry point → Historical catch-up: enables explicitly
kobo_sync/sync.py - Historical catch-up → Submission history: scans history
README.md - Kobo API client → Submission history: retrieves submissions
- Reconciliation → Deployed form: redeploys form
README.md - Deployed form → Form collector: makes choices available
README.md