GithubHelp home page GithubHelp logo

data_api's Introduction

ReadOnly API for Rapidpro data warehouse

This platform allows you to import RapidPRO data from multiple projects into a single place. It consumes RapidPro data via APIs and and re-serves that same data via those same APIs (but in aggregate). The current version is based off of the RapidPro V2 APIs.

Usage

To import and organization and all its data (once) run:

./manage.py sync_organization_data [apikey]

or

./manage.py sync_organization_data [apikey] --server https://myinstance.rapidpro.io

Dev Setup / Installation

Prerequisites

Setup Virtualenv

mkvirtualenv --no-site-packages rapidpro-dataapi

Install requirements:

Make sure you are in the root directory of the repository then run:

pipenv install -d

Configure settings

If you need non-default settings, create a localsettings.py file in data_api. Else you can use settings_dev.

For all ./manage.py commands, replace [settings module] with whichever settings module you need, e.g. data_api.settings_dev

If you don't want to specify your settings module every time, just add

export DJANGO_SETTINGS_MODULE=data_api.localsettings

to your $VIRTUAL_ENV/bin/postactivate file.

And add unset DJANGO_SETTINGS_MODULE to $VIRTUAL_ENV/bin/predeactivate to avoid it messing with other virtualenvs.

Setup Database

sudo -u postgres createdb rapidpro_data_api
./manage.py migrate --settings=[settings module]

Run Server

./manage.py runserver --settings [settings module]

Run Tests

./manage.py test

Or to run individual tests:

./manage.py test data_api.staging.tests.test_data_import.DataImportTest.test_import_boundaries

Deployment

Deployment is managed with fabric.

To deploy to the UNICEF environment run:

fab production deploy

To deploy to another environment you can run

fab deploy

and manually specify the host at runtime.

For more information about the UNICEF production instance, see production.md.

For guides to accomplishing specific tasks see cookbooks.md.

data_api's People

Contributors

czue avatar domdinicola avatar ewheeler avatar xkmato avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.