diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9084e43..9d1f6a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Produce RapidPro flows +name: Produce Poll Wrappers on: workflow_dispatch @@ -12,18 +12,21 @@ jobs: uses: actions/checkout@v4 - name: Install Node dependencies + working-directory: technical run: npm ci - name: Install Python dependencies + working-directory: technical run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Run pipeline - run: python -m parenttext_pipeline.cli pull_data compile_flows + working-directory: technical + run: python -m parenttext_pipeline.cli pull_data compile_flows - - name: Publish output folder + - name: Publish poll_wrappers.json uses: actions/upload-artifact@v3 with: - name: Output Files - path: output \ No newline at end of file + name: Poll Wrappers File + path: technical/output/poll_wrappers.json \ No newline at end of file diff --git a/README.md b/README.md index 949e8c4..5c6ab2c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ # Example poll wrapper -This project builds RapidPro flows +This project creates the wrapper flows that should be used alongside a poll within RapidPro. There is a pipeline which takes the csv inputs in the 'poll data' folder and creates the wrappers. + ## Usage The pipeline is intended to be run by triggering a Github Actions workflow or by running commands on the command line. -## Github actions (work in progress) +## Github actions -1. Navigate to the page for the [Produce RapidPro Flows][1] action +1. Navigate to the page for the [Produce Poll Wrappers][1] action 2. Click on the _Run workflow_ button; a drop-down will appear 3. Make sure _Branch_ is set to _main_ 4. Click on the green _Run workflow_ button @@ -20,6 +21,7 @@ These steps need to be followed if you want to run the pipeline from the command 1. Clone or fork the repo to a local folder 1. Install Python >= 3.8 +1. Change to the 'techical' folder where the config.json file is held and all code should be run from `cd technical` 1. Create a Python virtual environment `python -m venv .venv` 1. Activate the environment: - Linux: `source .venv/bin/activate` @@ -28,11 +30,9 @@ These steps need to be followed if you want to run the pipeline from the command 1. Install project Python dependencies `pip install -r requirements.txt` 1. Install latest Node and NPM Long-Term Support (LTS) versions 1. Install project Node dependencies `npm install` -1. Make sure you have a correct `credentials.json` file in the same directory as the cloned repo. ## Run - ``` python -m parenttext_pipeline.cli pull_data compile_flows ``` diff --git a/input/meta.json b/input/meta.json deleted file mode 100644 index 5a4e002..0000000 --- a/input/meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "pipeline_version": "1.1.1.dev21+g8225a4e.d20241031", - "config_version": "1.0.0", - "pull_timestamp": "2024-11-05 12:03:15.919358+00:00" -} \ No newline at end of file diff --git a/poll_data/poll_metadata.csv b/poll_data/poll_metadata.csv index de8167c..0b7cf0b 100644 --- a/poll_data/poll_metadata.csv +++ b/poll_data/poll_metadata.csv @@ -1,2 +1,2 @@ ID,poll_type,poll_name -ExampleDummyPoll,poll_type, \ No newline at end of file +ExampleDummyPoll,poll_type,HIV Poll diff --git a/.gitignore b/technical/.gitignore similarity index 100% rename from .gitignore rename to technical/.gitignore diff --git a/LICENSE b/technical/LICENSE similarity index 100% rename from LICENSE rename to technical/LICENSE diff --git a/__init__.py b/technical/__init__.py similarity index 100% rename from __init__.py rename to technical/__init__.py diff --git a/config.json b/technical/config.json similarity index 97% rename from config.json rename to technical/config.json index 96c9114..5c3ee38 100644 --- a/config.json +++ b/technical/config.json @@ -19,7 +19,7 @@ "subformat": "csv", "files_dict": { "workspace_data": "workspace_data", - "poll_data": "poll_data" + "poll_data": "../poll_data" } }, "expiration_times": { diff --git a/edits/safeguarding_words.json b/technical/edits/safeguarding_words.json similarity index 100% rename from edits/safeguarding_words.json rename to technical/edits/safeguarding_words.json diff --git a/edits/select_phrases.json b/technical/edits/select_phrases.json similarity index 100% rename from edits/select_phrases.json rename to technical/edits/select_phrases.json diff --git a/edits/special_words.json b/technical/edits/special_words.json similarity index 100% rename from edits/special_words.json rename to technical/edits/special_words.json diff --git a/edits/specific_expiration.json b/technical/edits/specific_expiration.json similarity index 100% rename from edits/specific_expiration.json rename to technical/edits/specific_expiration.json diff --git a/input/expiration_times/special_expiration_file.json b/technical/input/expiration_times/special_expiration_file.json similarity index 100% rename from input/expiration_times/special_expiration_file.json rename to technical/input/expiration_times/special_expiration_file.json diff --git a/input/flow_definitions/poll_data.json b/technical/input/flow_definitions/poll_data.json similarity index 100% rename from input/flow_definitions/poll_data.json rename to technical/input/flow_definitions/poll_data.json diff --git a/input/flow_definitions/workspace_data.json b/technical/input/flow_definitions/workspace_data.json similarity index 100% rename from input/flow_definitions/workspace_data.json rename to technical/input/flow_definitions/workspace_data.json diff --git a/technical/input/meta.json b/technical/input/meta.json new file mode 100644 index 0000000..706c361 --- /dev/null +++ b/technical/input/meta.json @@ -0,0 +1,5 @@ +{ + "pipeline_version": "1.0.1.dev11+g0f9c6d8", + "config_version": "1.0.0", + "pull_timestamp": "2024-11-07 14:31:26.485539+00:00" +} \ No newline at end of file diff --git a/input/qr_treatment/select_phrases_file.json b/technical/input/qr_treatment/select_phrases_file.json similarity index 100% rename from input/qr_treatment/select_phrases_file.json rename to technical/input/qr_treatment/select_phrases_file.json diff --git a/input/qr_treatment/special_words_file.json b/technical/input/qr_treatment/special_words_file.json similarity index 100% rename from input/qr_treatment/special_words_file.json rename to technical/input/qr_treatment/special_words_file.json diff --git a/models/parenttext_models.py b/technical/models/parenttext_models.py similarity index 100% rename from models/parenttext_models.py rename to technical/models/parenttext_models.py diff --git a/package-lock.json b/technical/package-lock.json similarity index 100% rename from package-lock.json rename to technical/package-lock.json diff --git a/package.json b/technical/package.json similarity index 100% rename from package.json rename to technical/package.json diff --git a/poll_data.zip b/technical/poll_data.zip similarity index 100% rename from poll_data.zip rename to technical/poll_data.zip diff --git a/requirements.txt b/technical/requirements.txt similarity index 100% rename from requirements.txt rename to technical/requirements.txt diff --git a/workspace_data/content_index.csv b/technical/workspace_data/content_index.csv similarity index 100% rename from workspace_data/content_index.csv rename to technical/workspace_data/content_index.csv diff --git a/workspace_data/poll_types.csv b/technical/workspace_data/poll_types.csv similarity index 100% rename from workspace_data/poll_types.csv rename to technical/workspace_data/poll_types.csv