Skip to content

Latest commit

 

History

History
93 lines (60 loc) · 2.69 KB

README.md

File metadata and controls

93 lines (60 loc) · 2.69 KB

Duva

Build Status

Duva is an API built using the FastAPI framework that provides functionality to create & periodically update Tableau Hyper databases from CSV files. Currently the application supports connection to an OnaData server from which it'll pull data from an XLSForm and periodically export to a Tableau Hyper database

Requirements

  • Python 3.6+
  • Redis

Installation

Via Docker

The application comes with a docker-compose.yml file to facilitate easier installation of the project. Note: The docker-compose.yml file is tailored for development environments

To start up the application via Docker run the docker-compose up command.

Alternative Installation

  1. Clone repository
$ git clone https://github.com/onaio/duva.git
  1. Create & start a virtual environment to install dependencies
$ virtualenv duva
$ source duva/bin/activate
  1. Install base dependencies
$ pip install -r requirements.pip
  1. (Optional: For developer environments) Install development dependencies.
$ pip install -r dev-requirements.pip
  1. Create postgres user & database for the application
$ psql -c "CREATE USER duva WITH PASSWORD 'duva';"
$ psql -c "CREATE DATABASE duva OWNER duva;"

At this point the application can be started. Note: Ensure the redis server has been started

$ ./scripts/start.sh

Configuration

The application can be configured either by manual editing of the app/settings.py file or via environment variables i.e export APP_NAME="Duva". More information on this here

API Documentation

Documentation on the API endpoints provided by the application can be accessed by first running the application and accessing the /docs route.

Testing

This project utilizes tox for testing. In order to run the test suite within this project run the following commands:

$ pip install tox
$ tox

Alternatively, if you'd like to test the application with only the python version currently installed in your computer follow these steps:

  1. Install the developer dependencies
$ pip install -r dev-requirements
  1. Run the test suite using pytest
$ ./scripts/run-tests.sh

OR

$ PYTHONPATH=. pytest -s app/tests