IDEMSInternational / rapidpro-flow-toolkit

Toolkit for using spreadsheets to create and modify RapidPro flows
GNU Lesser General Public License v2.1
3 stars 1 forks source link

CLI function to export data sheets to JSON #125

Open geoo89 opened 4 months ago

geoo89 commented 4 months ago

Implements CLI functionality to read one or multiple content indices, extract and merge the referenced data sheets into a single nested dictionary, and save it as JSON

Fixes #126

geoo89 commented 4 months ago

This stores data sheets in a nested dictionary, which is what we want. This is meant to be supplemented by #127 , which then effectively allows us to patch an existing deployment by switching out data sheets. (Which appears to be sufficient for ParentText in crisis, see https://github.com/IDEMSInternational/parenttext-crisis-deployment-template/issues/5) I think the vision is to change this patching through overwrites to patching through a diff format in the future, which is where storing data sheets in a nested format (as done here) rather than flat dictionaries merely encoding the sheet content, is useful.

However, sooner or later I assume we will most likely want to patch other types of sheets as well. From that point of view the holistic approach from #122 is what we want: A dict of sheets where can simply make overrides as we want. As long as we only make overrides of entire sheets, how a particular sheet is stored doesn't matter. The format only becomes relevant once we introduce diffs.

It would be good to have a discussion how to concretely implement data storage and this overriding mechanism in the context of parenttext in crisis (i.e. having a content base repo with additional repos for deployments of variations), taking into account the expected short-term needs and balancing that against the longer-term vision.