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


Build Status

Density estimates how full different parts of Columbia are, based on the number of devices connected to the WiFi (data graciously provided by CUIT in coordination with ESC).


Local Development

Density currently runs on Python 3.6.3 and PostgreSQL 9.6. Our Python dependencies are managed via Pipenv. If you have Python 3.6 already installed, just run:

pip install -U pipenv
pipenv install --dev


If you don't know how to install Python 3.6.3 and PostgreSQL 9.6 yourself, we also have a Vagrant setup. Go to Vagrant Downloads to download Vagrant, and then in the terminal run:

vagrant up
vagrant ssh

This should ssh you into vagrant@vagrant virtualmachine. Go to /vagrant and then run pipenv install --dev.

Environment variables

We use .env file (automatically loaded by pipenv) to handle configuration. This should automatically be created for you when you run ./scripts/ (or when Vagrant provisions itself).

In production, we use a different set of environment variables.

Running the Server

pipenv run flask run

to start the server. If you're using Vagrant, you'll have to run:

pipenv run flask run --host=


We use py.test for testing and flake8 for linting. All tests are defined in density/tests. To run tests locally, in the app root directory you should run:

pipenv run flake8
pipenv run py.test

We have Travis CI set-up to enforce passing tests.


Density is currently deployed on ADI's server via Docker (defined in the Dockerfile). To build the Docker image locally, install Docker and run:

docker build -t density .
docker run --net=host -d density

To deploy new changes or features on the server, first push your changes to the master branch and check that it builds on Travis CI. Afterwards push your changes to the deploy branch.

Project Layout

├──              -- API documentation
├── density
│   ├──       -- Load configuration from `.env` file
│   ├──         -- Raw data for rooms
│   ├──           -- Handle all database access
│   ├──     -- Build graphs for predictions
│   ├──     -- Bulk of the app logic
│   ├── -- Handle building hour display
│   ├──      -- Predictions for current day
│   ├── static/         -- Static assets for Flask
│   ├── templates/      -- Jinja2 templates for Flask
│   └── tests/          -- various tests
├── Dockerfile
├── Pipfile             -- List of Python dependencies
├── Pipfile.lock
├── scripts
│   ├──    -- Set-up PostgreSQL logic and `.env`
│   ├── drop.sql        -- Drop database
│   ├── dump.sql        -- Dump of database for development
│   ├── schema.sql      -- Database schema (for reference)
│   └──      -- Script to setup Vagrant
├── setup.cfg           -- Setup for CI
└── Vagrantfile