Rapidpro Sidekick

Build Passing/Failing on TravisCI.com Code Style: Black Code Coverage Rapidpro Sidekick Documentation Docker Automated build

Sidekick is a Django application which provides additional functionality to RapidPro through RapidPro’s webhooks within flow, as well as using RP’s REST API to initiate flows, update contact fields etc. In some respects it functions much like setting up serverless functions to handle webhooks and return responses. However there are some additional benefits to using a Django application, primarily User authentication and management, as well as management of RapidPro Orgs.

Local installation

To set up and run rp-sidekick locally, do the following:

$ git clone git@github.com:praekeltfoundation/rp-sidekick.git
$ cd rp-sidekick
$ virtualenv ve
$ source ve/bin/activate
$ pip install -e .
$ pip install -r requirements-dev.txt
$ pre-commit install

RP-Sidekick does not work with SQLite because it uses JSONFields. This means that you will need to set up PostgreSQL locally. You can spin up a local db with docker, using the following command:

$ docker run -d -p 5432:5432 --name=sidekick_db -e POSTGRES_DB=rp_sidekick postgres:9.6

Tools

  • black - this repository uses an opinionated python code formatter. See pyproject.toml for config.
  • pre-commit - lints staged code as a git pre-commit check. Will prevent commits if linting fails. Currently runs black, flake8 and yamllint.

Contributing

See our ways of working for a guide on how to contribute to rp-sidekick.

VERSIONS

Next Release

1.2.1

  • Reformat with updated black package

1.2.0

  • Sidekick: Added a check contact endpoint for WhatsApp

1.1.0

  • Sidekick: Fixed document structure and updated docs
  • Sidekick: updated WA templated message endpoint to accept multiple localizable params
  • BREAKING: any flows that call the /send_template/ endpoints must change the param message= to 0=

1.0.17

  • TransferTo: Added error code to responses where TransferToClient returns an error

1.0.16

  • ASOS: Fixed notification for empty screening record.

1.0.15

  • TransferTo: added hacky fallback method for product purchase and take action task

1.0.14

  • TransferTo: refactored task functionality into to take_action function - updates RapidPro fields and/or starts another flow
  • TransferTo: add endpoint which purchases airtime, then updates RapidPro state with new take_action function
  • Sidekick: add email functionality in settings
  • TransferTo: send email on TransferTo failure task; buy_product_take_action

1.0.13

  • TransferTo: default to using cached msisdn number in views
  • TransferTo: add endpoint which purchases product then updates fields and/or starts another flow

1.0.12

  • TransferTo: store data on number in database
  • TransferTo: use cached msisdn number in tasks
  • TransferTo: refactored tests for tasks
  • Redcap: Allow blank Nomination url
  • Redcap: Send names when starting patient reminder flow

1.0.11

  • Install PyCap from Github commit until they make a release(temporary)
  • Add Hospital and PatientRecord to admin site

1.0.10

  • Added function to do WhatsApp contact check
  • Added function to update Rapidpro Contact with WhatsApp ID
  • Redcap: Added tasks to send patient data collection reminders
  • Redcap: Fixed updated_at field for values

1.0.9

  • Django version bump

1.0.8

  • Clean message before sending to Engage