Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

ciCoverage Status


An API that provides an interface to search complaint data.


  • Search complaint data
  • Suggest complaint data based on input
  • Get complaint based on ID


Requirements are batch-installed via pip (see below).

  • django - Web framework
  • django-localflavor - Country-specific Django helpers
  • djangorestframework - Rest API framework
  • elasticsearch - low level client for Elasticsearch
  • requests - http requests to get different data format

Setup & Running

This repository assumes that you have an instance of elasticsearch running with complaint data set up and running.

Environment Variables

This project uses environment variables and uses autoenv to automatically define environment variables and launch the virtualenv upon cding to the project folder.

You will need to install Autoenv if you haven't:

brew install autoenv

After installation, Homebrew will output instructions similar to:

To finish the installation, source in your shell:
  source /Users/[YOUR USERNAME]/homebrew/opt/autoenv/

Run that now for your initial setup. Any time you run the project you’ll need to run that last line, so if you’ll be working with the project consistently, we suggest adding it to your Bash profile by running:

echo 'source /Users/[YOUR USERNAME]/homebrew/opt/autoenv/' >> ~/.bash_profile

If you need to find this info again later, you can run:

brew info autoenv

You can then copy the .env_SAMPLE file to .env, then update any environment variables accordingly.


First, create a virtual environment for Python dependencies:

mkvirtualenv ccdb5-api

Next, use pip to install dependencies, which are defined in

pip install -e '.[testing]'

With that, you just need a few additional commands to get up and running:

python runserver

API Docs

Documentation for this repository is rendered via GitHub pages and Swagger. They can be edited in the docs/ directory, but to build or deploy them, you'll need to install docs requirements:

pip install -r docs_requirements.txt

You can then preview your changes locally by running mkdocs serve and then reviewing

When your changes are ready, you can submit them as a normal pull request. After that, you can use this command to publish them:

mkdocs gh-deploy --clean

That pushes the necessary files to the gh-pages branch.


  • The mkdocs gh-deploy command will push any edits you've made locally to the gh-pages branch of the repository, whether you've committed them or not.
  • Mkdocs will create a "site" directory locally when you use either build, serve or gh-deploy. This is used to assemble assets to be pushed to the gh-pages branch, but the site/ directory itself doesn't need to be under version control. It can be deleted after a deploy.

Running Tests

If you have Tox installed (recommended), you can run the specs for this project with the tox command.

If not, this command will run the specs on the python version your local environment has installed: ./ test.

If you run the tests via Tox, it will automatically display spec coverage information. To get test coverage information outside of Tox, install and run these commands:

coverage erase
coverage run test
coverage report