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
- Python 3.6+
- Redis
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.
- Clone repository
$ git clone https://github.com/onaio/duva.git
- Create & start a virtual environment to install dependencies
$ virtualenv duva
$ source duva/bin/activate
- Install base dependencies
$ pip install -r requirements.pip
- (Optional: For developer environments) Install development dependencies.
$ pip install -r dev-requirements.pip
- 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
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
Documentation on the API endpoints provided by the application can be accessed by first running the application and accessing the /docs
route.
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:
- Install the developer dependencies
$ pip install -r dev-requirements
- Run the test suite using pytest
$ ./scripts/run-tests.sh
OR
$ PYTHONPATH=. pytest -s app/tests