DataViva is a research tool that provides official data about exportation, economic activity, locality, education and occupation in Brazil. DataViva API is built using the following technology stack.
- Amazon Redshift
This installation guide is written assuming a Linux or Linux-like environment.
- Clone from github (this will create dataviva folder in the current directory)
git clone https://github.com/DataViva/dataviva-api.git
- [optional] Create a virtual environment. We suggest installing virtualenv with virtualenvwrapper especially if the machine you are using is used for many other web projects. This allows python libraries to be installed easily and specifically on a per project basis.
Once this is complete, run the following to initialize your dataviva environment.
mkvirtualenv dataviva-api workon dataviva-api
- Install the required Python libraries
pip install -r requirements.txt
- Set the following environment variables
(if using virtualenv) add the following to to the bottom of your virtualenv activate file (virtualenv_root/bin/activate).
export ENV= export REDIS_HOST= export REDIS_PORT export REDIS_DB export DATAVIVA_REDSHIFT_USER= export DATAVIVA_REDSHIFT_PW= export DATAVIVA_REDSHIFT_HOST= export DATAVIVA_REDSHIFT_NAME= export S3_PUBLIC_BUCKET_URL=
- Run api
python manage.py runserver
The API documentation is available in the wiki page.